This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / um / kernel / skas / trap_user.c
1 /* 
2  * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com)
3  * Licensed under the GPL
4  */
5
6 #include <signal.h>
7 #include <errno.h>
8 #include <asm/sigcontext.h>
9 #include "sysdep/ptrace.h"
10 #include "signal_user.h"
11 #include "user_util.h"
12 #include "kern_util.h"
13 #include "task.h"
14 #include "sigcontext.h"
15
16 void sig_handler_common_skas(int sig, void *sc_ptr)
17 {
18         struct sigcontext *sc = sc_ptr;
19         struct skas_regs *r;
20         struct signal_info *info;
21         int save_errno = errno;
22
23         r = &TASK_REGS(get_current())->skas;
24         r->is_user = 0;
25         r->fault_addr = SC_FAULT_ADDR(sc);
26         r->fault_type = SC_FAULT_TYPE(sc);
27         r->trap_type = SC_TRAP_TYPE(sc);
28
29         change_sig(SIGUSR1, 1);
30         info = &sig_info[sig];
31         if(!info->is_irq) unblock_signals();
32
33         (*info->handler)(sig, (union uml_pt_regs *) r);
34
35         errno = save_errno;
36 }
37
38 void user_signal(int sig, union uml_pt_regs *regs)
39 {
40         struct signal_info *info;
41
42         regs->skas.is_user = 1;
43         regs->skas.fault_addr = 0;
44         regs->skas.fault_type = 0;
45         regs->skas.trap_type = 0;
46         info = &sig_info[sig];
47         (*info->handler)(sig, regs);
48
49         unblock_signals();
50 }
51
52 /*
53  * Overrides for Emacs so that we follow Linus's tabbing style.
54  * Emacs will notice this stuff at the end of the file and automatically
55  * adjust the settings for this buffer only.  This must remain at the end
56  * of the file.
57  * ---------------------------------------------------------------------------
58  * Local variables:
59  * c-file-style: "linux"
60  * End:
61  */