ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / um / kernel / skas / trap_user.c
1 /* 
2  * Copyright (C) 2002 Jeff Dike (jdike@karaya.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 extern int missed_ticks[];
39
40 void user_signal(int sig, union uml_pt_regs *regs)
41 {
42         struct signal_info *info;
43
44         if(sig == SIGVTALRM)
45                 missed_ticks[cpu()]++;
46         regs->skas.is_user = 1;
47         regs->skas.fault_addr = 0;
48         regs->skas.fault_type = 0;
49         regs->skas.trap_type = 0;
50         info = &sig_info[sig];
51         (*info->handler)(sig, regs);
52
53         unblock_signals();
54 }
55
56 /*
57  * Overrides for Emacs so that we follow Linus's tabbing style.
58  * Emacs will notice this stuff at the end of the file and automatically
59  * adjust the settings for this buffer only.  This must remain at the end
60  * of the file.
61  * ---------------------------------------------------------------------------
62  * Local variables:
63  * c-file-style: "linux"
64  * End:
65  */