2 * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com)
3 * Licensed under the GPL
8 #include "sysdep/ptrace.h"
9 #include "signal_user.h"
10 #include "user_util.h"
11 #include "kern_util.h"
13 #include "sigcontext.h"
15 void sig_handler_common_skas(int sig, void *sc_ptr)
17 struct sigcontext *sc = sc_ptr;
19 struct signal_info *info;
20 int save_errno = errno;
23 /* This is done because to allow SIGSEGV to be delivered inside a SEGV
24 * handler. This can happen in copy_user, and if SEGV is disabled,
25 * the process will die.
26 * XXX Figure out why this is better than SA_NODEFER
29 change_sig(SIGSEGV, 1);
31 r = &TASK_REGS(get_current())->skas;
32 save_user = r->is_user;
34 r->fault_addr = SC_FAULT_ADDR(sc);
35 r->fault_type = SC_FAULT_TYPE(sc);
36 r->trap_type = SC_TRAP_TYPE(sc);
38 change_sig(SIGUSR1, 1);
39 info = &sig_info[sig];
40 if(!info->is_irq) unblock_signals();
42 (*info->handler)(sig, (union uml_pt_regs *) r);
45 r->is_user = save_user;
48 void user_signal(int sig, union uml_pt_regs *regs)
50 struct signal_info *info;
52 regs->skas.is_user = 1;
53 regs->skas.fault_addr = 0;
54 regs->skas.fault_type = 0;
55 regs->skas.trap_type = 0;
56 info = &sig_info[sig];
57 (*info->handler)(sig, regs);
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"