From df043c5a4a7246bab87452928d83f6bf43d6bac0 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Thu, 9 Jul 2020 17:35:51 -0400 Subject: [PATCH] chore: assert preemp disabled on mcontext restore --- runtime/include/arch/x86_64/context.h | 3 +++ runtime/include/software_interrupt.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/runtime/include/arch/x86_64/context.h b/runtime/include/arch/x86_64/context.h index 62dc0c7..01fe1a8 100644 --- a/runtime/include/arch/x86_64/context.h +++ b/runtime/include/arch/x86_64/context.h @@ -7,6 +7,8 @@ #include #include +#include "software_interrupt.h" + #define ARCH_SIG_JMP_OFF 8 // Userspace Registers. @@ -73,6 +75,7 @@ static int arch_mcontext_restore(mcontext_t *mc, arch_context_t *ctx) { assert(ctx != &worker_thread_base_context); + assert(!software_interrupt_is_enabled()); /* if ctx->regs[0] is set, this was last in a user-level context switch state! * else restore mcontext.. diff --git a/runtime/include/software_interrupt.h b/runtime/include/software_interrupt.h index 5fb63ce..bb167b5 100644 --- a/runtime/include/software_interrupt.h +++ b/runtime/include/software_interrupt.h @@ -3,6 +3,8 @@ #include #include #include +#include +#include /************ * Externs *