|
|
@ -3,6 +3,8 @@
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "panic.h"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Called by the inline assembly in arch_context_switch to send a SIGUSR1 in order to restore a previously preempted
|
|
|
|
* Called by the inline assembly in arch_context_switch to send a SIGUSR1 in order to restore a previously preempted
|
|
|
|
* thread. The only way to restore all of the mcontext registers of a preempted sandbox is to send ourselves a signal,
|
|
|
|
* thread. The only way to restore all of the mcontext registers of a preempted sandbox is to send ourselves a signal,
|
|
|
@ -12,5 +14,5 @@
|
|
|
|
void __attribute__((noinline)) __attribute__((noreturn)) arch_context_restore_preempted(void)
|
|
|
|
void __attribute__((noinline)) __attribute__((noreturn)) arch_context_restore_preempted(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pthread_kill(pthread_self(), SIGUSR1);
|
|
|
|
pthread_kill(pthread_self(), SIGUSR1);
|
|
|
|
abort();
|
|
|
|
panic("Unexpectedly reached code after sending self SIGUSR1\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|