From 9a963f1d0c4f560572c5a4f3d5b567b7fa13ebb8 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Sat, 18 Jul 2020 14:23:02 -0400 Subject: [PATCH] refactor: rename confusing function name --- runtime/include/arch/aarch64/context.h | 2 +- runtime/include/arch/common.h | 2 +- runtime/include/arch/x86_64/context.h | 4 ++-- runtime/src/arch_context.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/include/arch/aarch64/context.h b/runtime/include/arch/aarch64/context.h index b88f474..067a7d4 100644 --- a/runtime/include/arch/aarch64/context.h +++ b/runtime/include/arch/aarch64/context.h @@ -69,7 +69,7 @@ arch_context_switch(struct arch_context *current, struct arch_context *next) "exit%=:\n\t" : : [ current ] "r"(current_registers), [ next ] "r"(next_registers), - [ slowpath ] "r"(&arch_context_mcontext_restore) + [ slowpath ] "r"(&arch_context_restore_preempted) : "memory", "cc", "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", "x24", "x25", "x26", "d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15"); diff --git a/runtime/include/arch/common.h b/runtime/include/arch/common.h index 3650209..edd867d 100644 --- a/runtime/include/arch/common.h +++ b/runtime/include/arch/common.h @@ -50,6 +50,6 @@ struct arch_context { extern __thread struct arch_context worker_thread_base_context; /* Cannot be inlined because called in assembly */ -void __attribute__((noinline)) __attribute__((noreturn)) arch_context_mcontext_restore(void); +void __attribute__((noinline)) __attribute__((noreturn)) arch_context_restore_preempted(void); extern __thread volatile bool worker_thread_is_switching_context; diff --git a/runtime/include/arch/x86_64/context.h b/runtime/include/arch/x86_64/context.h index fd1e815..5a0857c 100644 --- a/runtime/include/arch/x86_64/context.h +++ b/runtime/include/arch/x86_64/context.h @@ -107,11 +107,11 @@ arch_context_switch(struct arch_context *current, struct arch_context *next) * Slow Path * If the variant is arch_context_slow, that means the sandbox was preempted and we need to * fallback to a full mcontext-based context switch. We do this by invoking - * arch_context_mcontext_restore, which fires a SIGUSR1 signal. The SIGUSR1 signal handler + * arch_context_restore_preempted, which fires a SIGUSR1 signal. The SIGUSR1 signal handler * executes the mcontext-based context switch. */ "1:\n\t" - "call arch_context_mcontext_restore\n\t" + "call arch_context_restore_preempted\n\t" ".align 8\n\t" /* diff --git a/runtime/src/arch_context.c b/runtime/src/arch_context.c index a1851a9..e2874e8 100644 --- a/runtime/src/arch_context.c +++ b/runtime/src/arch_context.c @@ -9,7 +9,7 @@ * then update the registers we should return to, then sigreturn (by returning from the handler). This returns to the * control flow restored from the mcontext */ -void __attribute__((noinline)) __attribute__((noreturn)) arch_context_mcontext_restore(void) +void __attribute__((noinline)) __attribute__((noreturn)) arch_context_restore_preempted(void) { pthread_kill(pthread_self(), SIGUSR1); assert(false);