void test_syscall_ins(void);
extern const char test_page[];
-static void const *current_test_page_addr = test_page;
+static const void *current_test_page_addr = test_page;
/* State used by our signal handlers. */
static gregset_t initial_regs;
static void sigsegv_for_sigreturn_test(int sig, siginfo_t *info, void *ctx_void)
{
- ucontext_t *ctx = (ucontext_t*)ctx_void;
+ ucontext_t *ctx = (ucontext_t *)ctx_void;
if (rip != ctx->uc_mcontext.gregs[REG_RIP]) {
printf("[FAIL]\tRequested RIP=0x%lx but got RIP=0x%lx\n",
static void sigusr1(int sig, siginfo_t *info, void *ctx_void)
{
- ucontext_t *ctx = (ucontext_t*)ctx_void;
+ ucontext_t *ctx = (ucontext_t *)ctx_void;
memcpy(&initial_regs, &ctx->uc_mcontext.gregs, sizeof(gregset_t));
ctx->uc_mcontext.gregs[REG_R11]);
sethandler(SIGSEGV, sigsegv_for_sigreturn_test, SA_RESETHAND);
-
- return;
}
static void test_sigreturn_to(unsigned long ip)
static void sigsegv_for_fallthrough(int sig, siginfo_t *info, void *ctx_void)
{
- ucontext_t *ctx = (ucontext_t*)ctx_void;
+ ucontext_t *ctx = (ucontext_t *)ctx_void;
if (rip != ctx->uc_mcontext.gregs[REG_RIP]) {
printf("[FAIL]\tExpected SIGSEGV at 0x%lx but got RIP=0x%lx\n",
printf("[OK]\tWe survived\n");
}
-int main()
+int main(void)
{
/*
* When the kernel returns from a slow-path syscall, it will