refactor: rename confusing function name

main
Sean McBride 4 years ago
parent f51fd1ef80
commit 9a963f1d0c

@ -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");

@ -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;

@ -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"
/*

@ -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);

Loading…
Cancel
Save