xref: /linux/arch/x86/um/stub_segv.c (revision 1ac731c529cd4d6adbce134754b51ff7d822b145)
15c48b108SAl Viro /*
25c48b108SAl Viro  * Copyright (C) 2004 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
35c48b108SAl Viro  * Licensed under the GPL
45c48b108SAl Viro  */
55c48b108SAl Viro 
637185b33SAl Viro #include <sysdep/stub.h>
737185b33SAl Viro #include <sysdep/faultinfo.h>
837185b33SAl Viro #include <sysdep/mcontext.h>
9530ba6c7SJason A. Donenfeld #include <sys/ucontext.h>
105c48b108SAl Viro 
11bf9a76a4SLinus Torvalds void __attribute__ ((__section__ (".__syscall_stub")))
stub_segv_handler(int sig,siginfo_t * info,void * p)125c48b108SAl Viro stub_segv_handler(int sig, siginfo_t *info, void *p)
135c48b108SAl Viro {
14*6032aca0SJohannes Berg 	struct faultinfo *f = get_stub_data();
154d1a535bSKrzysztof Mazur 	ucontext_t *uc = p;
165c48b108SAl Viro 
179f0b4807SJohannes Berg 	GET_FAULTINFO_FROM_MC(*f, &uc->uc_mcontext);
185c48b108SAl Viro 	trap_myself();
195c48b108SAl Viro }
205c48b108SAl Viro 
21