chore: assert preemp disabled on mcontext restore

main
Sean McBride 4 years ago
parent 3d9829e6b3
commit df043c5a4a

@ -7,6 +7,8 @@
#include <ucontext.h> #include <ucontext.h>
#include <unistd.h> #include <unistd.h>
#include "software_interrupt.h"
#define ARCH_SIG_JMP_OFF 8 #define ARCH_SIG_JMP_OFF 8
// Userspace Registers. // Userspace Registers.
@ -73,6 +75,7 @@ static int
arch_mcontext_restore(mcontext_t *mc, arch_context_t *ctx) arch_mcontext_restore(mcontext_t *mc, arch_context_t *ctx)
{ {
assert(ctx != &worker_thread_base_context); 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! /* if ctx->regs[0] is set, this was last in a user-level context switch state!
* else restore mcontext.. * else restore mcontext..

@ -3,6 +3,8 @@
#include <assert.h> #include <assert.h>
#include <signal.h> #include <signal.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
/************ /************
* Externs * * Externs *

Loading…
Cancel
Save