Jeff Dike | d67b569 | 2005-07-07 17:56:49 -0700 | [diff] [blame] | 1 | /* |
Jeff Dike | ee3d9bd | 2008-02-04 22:30:56 -0800 | [diff] [blame] | 2 | * Copyright (C) 2004 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
Jeff Dike | d67b569 | 2005-07-07 17:56:49 -0700 | [diff] [blame] | 3 | * Licensed under the GPL |
4 | */ | ||||
5 | |||||
Jeff Dike | 17d4697 | 2005-11-21 21:32:09 -0800 | [diff] [blame] | 6 | #include "sysdep/stub.h" |
Jeff Dike | ee3d9bd | 2008-02-04 22:30:56 -0800 | [diff] [blame] | 7 | #include "sysdep/faultinfo.h" |
8 | #include "sysdep/sigcontext.h" | ||||
Jeff Dike | d67b569 | 2005-07-07 17:56:49 -0700 | [diff] [blame] | 9 | |
10 | void __attribute__ ((__section__ (".__syscall_stub"))) | ||||
Al Viro | 9b25fcb | 2011-08-18 20:04:09 +0100 | [diff] [blame] | 11 | stub_segv_handler(int sig, siginfo_t *info, void *p) |
Jeff Dike | d67b569 | 2005-07-07 17:56:49 -0700 | [diff] [blame] | 12 | { |
Al Viro | 9b25fcb | 2011-08-18 20:04:09 +0100 | [diff] [blame] | 13 | struct ucontext *uc = p; |
Jeff Dike | d67b569 | 2005-07-07 17:56:49 -0700 | [diff] [blame] | 14 | |
Jeff Dike | 54ae36f | 2007-10-16 01:27:33 -0700 | [diff] [blame] | 15 | GET_FAULTINFO_FROM_SC(*((struct faultinfo *) STUB_DATA), |
Jeff Dike | 50f72b5 | 2005-10-09 16:11:44 -0400 | [diff] [blame] | 16 | &uc->uc_mcontext); |
Jeff Dike | ee3d9bd | 2008-02-04 22:30:56 -0800 | [diff] [blame] | 17 | trap_myself(); |
Jeff Dike | d67b569 | 2005-07-07 17:56:49 -0700 | [diff] [blame] | 18 | } |
Jeff Dike | ee3d9bd | 2008-02-04 22:30:56 -0800 | [diff] [blame] | 19 |