From 31c3a9329ac22ea62eed9bc97a0c8e03467f3d4e Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Sat, 18 Jul 2020 09:10:38 -0400 Subject: [PATCH] refactor: rename QUICK to FAST --- runtime/include/arch/aarch64/context.h | 2 +- runtime/include/arch/common.h | 2 +- runtime/include/arch/context.h | 2 +- runtime/include/arch/x86_64/context.h | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/runtime/include/arch/aarch64/context.h b/runtime/include/arch/aarch64/context.h index 4b98314..2b69ae9 100644 --- a/runtime/include/arch/aarch64/context.h +++ b/runtime/include/arch/aarch64/context.h @@ -20,7 +20,7 @@ arch_context_init(struct arch_context *actx, reg_t ip, reg_t sp) actx->regs[UREG_RSP] = sp; actx->regs[UREG_RIP] = ip; - actx->variant = ARCH_CONTEXT_QUICK; + actx->variant = ARCH_CONTEXT_FAST; } /** diff --git a/runtime/include/arch/common.h b/runtime/include/arch/common.h index 343107c..d65fcec 100644 --- a/runtime/include/arch/common.h +++ b/runtime/include/arch/common.h @@ -26,7 +26,7 @@ enum UREGS enum ARCH_CONTEXT { ARCH_CONTEXT_UNUSED = 0, - ARCH_CONTEXT_QUICK = 1, + ARCH_CONTEXT_FAST = 1, ARCH_CONTEXT_SLOW = 2, ARCH_CONTEXT_RUNNING = 3 }; diff --git a/runtime/include/arch/context.h b/runtime/include/arch/context.h index c0b2d68..14cffac 100644 --- a/runtime/include/arch/context.h +++ b/runtime/include/arch/context.h @@ -58,7 +58,7 @@ arch_context_restore(mcontext_t *active_context, struct arch_context *sandbox_co { assert(active_context != NULL); assert(sandbox_context != NULL); - assert(sandbox_context->variant == ARCH_CONTEXT_QUICK); + assert(sandbox_context->variant == ARCH_CONTEXT_FAST); assert(sandbox_context != &worker_thread_base_context); /* TODO: Phani explained that we need to be able to restore a sandbox with an IP of 0. Why is this? */ diff --git a/runtime/include/arch/x86_64/context.h b/runtime/include/arch/x86_64/context.h index 7bcbce5..60ad151 100644 --- a/runtime/include/arch/x86_64/context.h +++ b/runtime/include/arch/x86_64/context.h @@ -38,7 +38,7 @@ static void __attribute__((noinline)) arch_context_init(struct arch_context *act actx->regs[UREG_RSP] = sp; actx->regs[UREG_RIP] = ip; - actx->variant = ARCH_CONTEXT_QUICK; + actx->variant = ARCH_CONTEXT_FAST; } @@ -56,8 +56,8 @@ arch_context_switch(struct arch_context *current, struct arch_context *next) /* Assumption: Software Interrupts are disabled by caller */ assert(software_interrupt_is_disabled); - if (next->variant == ARCH_CONTEXT_QUICK && (next->regs[UREG_RIP] == 0 || next->regs[UREG_RSP] == 0)) { - debuglog("Next Context was Quick Variant, but data was invalid."); + if (next->variant == ARCH_CONTEXT_FAST && (next->regs[UREG_RIP] == 0 || next->regs[UREG_RSP] == 0)) { + debuglog("Next Context was Fast Variant, but data was invalid."); assert(0); } @@ -72,7 +72,7 @@ arch_context_switch(struct arch_context *current, struct arch_context *next) if (next == NULL) next = &worker_thread_base_context; /* Assumption: The context we are switching to should have saved a context in some form */ - assert(next->variant == ARCH_CONTEXT_QUICK || next->variant != ARCH_CONTEXT_UNUSED); + assert(next->variant == ARCH_CONTEXT_FAST || next->variant != ARCH_CONTEXT_UNUSED); reg_t *current_registers = current->regs, *next_registers = next->regs; assert(current_registers && next_registers); @@ -87,7 +87,7 @@ arch_context_switch(struct arch_context *current, struct arch_context *next) */ "movq $2f, 8(%%rax)\n\t" /* Write the address of label 2 to current_registers[1] (instruction_pointer). */ "movq %%rsp, (%%rax)\n\t" /* current_registers[0] (stack_pointer) = stack_pointer */ - "movq $1, (%%rcx)\n\t" /* current->variant = ARCH_CONTEXT_QUICK; */ + "movq $1, (%%rcx)\n\t" /* current->variant = ARCH_CONTEXT_FAST; */ /* * Check if the variant of the context we're trying to switch to is SLOW (mcontext-based) @@ -119,7 +119,7 @@ arch_context_switch(struct arch_context *current, struct arch_context *next) * The sandbox either resumes at label 2 or 3 depending on if an offset of 8 is used. */ "2:\n\t" - "movq $3, (%%rdx)\n\t" /* next->variant = ARCH_CONTEXT_QUICK; */ + "movq $3, (%%rdx)\n\t" /* next->variant = ARCH_CONTEXT_FAST; */ ".align 8\n\t" /* This label is used in conjunction with a static offset */