2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
9 #include "sysdep/ptrace.h"
10 #include "sysdep/sigcontext.h"
11 #include "user_util.h"
12 #include "kern_util.h"
17 void sig_handler_common_tt(int sig
, void *sc_ptr
)
19 struct sigcontext
*sc
= sc_ptr
;
20 struct tt_regs save_regs
, *r
;
21 int save_errno
= errno
, is_user
= 0;
22 void (*handler
)(int, union uml_pt_regs
*);
24 /* This is done because to allow SIGSEGV to be delivered inside a SEGV
25 * handler. This can happen in copy_user, and if SEGV is disabled,
26 * the process will die.
29 change_sig(SIGSEGV
, 1);
31 r
= &TASK_REGS(get_current())->tt
;
32 if ( sig
== SIGFPE
|| sig
== SIGSEGV
||
33 sig
== SIGBUS
|| sig
== SIGILL
||
35 GET_FAULTINFO_FROM_SC(r
->faultinfo
, sc
);
39 is_user
= user_context(SC_SP(sc
));
44 handler
= sig_info
[sig
];
46 /* unblock SIGALRM, SIGVTALRM, SIGIO if sig isn't IRQ signal */
47 if (sig
!= SIGIO
&& sig
!= SIGWINCH
&&
48 sig
!= SIGVTALRM
&& sig
!= SIGALRM
)
51 handler(sig
, (union uml_pt_regs
*) r
);
63 * Overrides for Emacs so that we follow Linus's tabbing style.
64 * Emacs will notice this stuff at the end of the file and automatically
65 * adjust the settings for this buffer only. This must remain at the end
67 * ---------------------------------------------------------------------------
69 * c-file-style: "linux"