xref: /linux/arch/x86/um/stub_segv.c (revision 9dbbc3b9d09d6deba9f3b9e1d5b355032ed46a75)
1 /*
2  * Copyright (C) 2004 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3  * Licensed under the GPL
4  */
5 
6 #include <sysdep/stub.h>
7 #include <sysdep/faultinfo.h>
8 #include <sysdep/mcontext.h>
9 #include <sys/ucontext.h>
10 
11 void __attribute__ ((__section__ (".__syscall_stub")))
12 stub_segv_handler(int sig, siginfo_t *info, void *p)
13 {
14 	int stack;
15 	ucontext_t *uc = p;
16 	struct faultinfo *f = (void *)(((unsigned long)&stack) & ~(UM_KERN_PAGE_SIZE - 1));
17 
18 	GET_FAULTINFO_FROM_MC(*f, &uc->uc_mcontext);
19 	trap_myself();
20 }
21 
22