2 * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com)
3 * Licensed under the GPL
11 #include "sigcontext.h"
13 #include "ptrace_user.h"
14 #include "sysdep/ptrace.h"
15 #include "sysdep/ptrace_user.h"
18 void sig_handler_common_skas(int sig
, void *sc_ptr
)
20 struct sigcontext
*sc
= sc_ptr
;
22 void (*handler
)(int, union uml_pt_regs
*);
23 int save_user
, save_errno
= errno
;
25 /* This is done because to allow SIGSEGV to be delivered inside a SEGV
26 * handler. This can happen in copy_user, and if SEGV is disabled,
27 * the process will die.
28 * XXX Figure out why this is better than SA_NODEFER
31 change_sig(SIGSEGV
, 1);
33 r
= TASK_REGS(get_current());
34 save_user
= r
->skas
.is_user
;
36 if ( sig
== SIGFPE
|| sig
== SIGSEGV
||
37 sig
== SIGBUS
|| sig
== SIGILL
||
39 GET_FAULTINFO_FROM_SC(r
->skas
.faultinfo
, sc
);
42 change_sig(SIGUSR1
, 1);
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
)
54 r
->skas
.is_user
= save_user
;
57 extern int ptrace_faultinfo
;
59 void user_signal(int sig
, union uml_pt_regs
*regs
, int pid
)
61 void (*handler
)(int, union uml_pt_regs
*);
62 int segv
= ((sig
== SIGFPE
) || (sig
== SIGSEGV
) || (sig
== SIGBUS
) ||
63 (sig
== SIGILL
) || (sig
== SIGTRAP
));
66 get_skas_faultinfo(pid
, ®s
->skas
.faultinfo
);
68 handler
= sig_info
[sig
];
69 handler(sig
, (union uml_pt_regs
*) regs
);