aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-05-06 17:51:24 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:13:02 -0400
commit5d86456d3852cb95a38d2b23fe01cede54984ba5 (patch)
treea0e973d629717d93c7b4dc32ad7afd9e64f5f974 /arch/um/os-Linux
parentccdddb57874522e6b267204f9c5e94ba7d9d66b0 (diff)
uml: tidy fault code
Tidying in preparation for the segfault register dumping patch which follows. void * pointers are changed to union uml_pt_regs *. This makes the types match reality, except in arch_fixup, which is changed to operate on a union uml_pt_regs. This fixes a bug in the call from segv_handler, which passes a union uml_pt_regs, to segv, which expects to pass a struct sigcontext to arch_fixup. Whitespace and other style fixes. There's also a errno printk fix. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux')
-rw-r--r--arch/um/os-Linux/skas/trap.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/um/os-Linux/skas/trap.c b/arch/um/os-Linux/skas/trap.c
index f104427d2caf..6a20d08caf91 100644
--- a/arch/um/os-Linux/skas/trap.c
+++ b/arch/um/os-Linux/skas/trap.c
@@ -18,10 +18,9 @@
18void sig_handler_common_skas(int sig, void *sc_ptr) 18void sig_handler_common_skas(int sig, void *sc_ptr)
19{ 19{
20 struct sigcontext *sc = sc_ptr; 20 struct sigcontext *sc = sc_ptr;
21 struct skas_regs *r; 21 union uml_pt_regs *r;
22 void (*handler)(int, union uml_pt_regs *); 22 void (*handler)(int, union uml_pt_regs *);
23 int save_errno = errno; 23 int save_user, save_errno = errno;
24 int save_user;
25 24
26 /* This is done because to allow SIGSEGV to be delivered inside a SEGV 25 /* This is done because to allow SIGSEGV to be delivered inside a SEGV
27 * handler. This can happen in copy_user, and if SEGV is disabled, 26 * handler. This can happen in copy_user, and if SEGV is disabled,
@@ -31,13 +30,13 @@ void sig_handler_common_skas(int sig, void *sc_ptr)
31 if(sig == SIGSEGV) 30 if(sig == SIGSEGV)
32 change_sig(SIGSEGV, 1); 31 change_sig(SIGSEGV, 1);
33 32
34 r = &TASK_REGS(get_current())->skas; 33 r = TASK_REGS(get_current());
35 save_user = r->is_user; 34 save_user = r->skas.is_user;
36 r->is_user = 0; 35 r->skas.is_user = 0;
37 if ( sig == SIGFPE || sig == SIGSEGV || 36 if ( sig == SIGFPE || sig == SIGSEGV ||
38 sig == SIGBUS || sig == SIGILL || 37 sig == SIGBUS || sig == SIGILL ||
39 sig == SIGTRAP ) { 38 sig == SIGTRAP ) {
40 GET_FAULTINFO_FROM_SC(r->faultinfo, sc); 39 GET_FAULTINFO_FROM_SC(r->skas.faultinfo, sc);
41 } 40 }
42 41
43 change_sig(SIGUSR1, 1); 42 change_sig(SIGUSR1, 1);
@@ -49,10 +48,10 @@ void sig_handler_common_skas(int sig, void *sc_ptr)
49 sig != SIGVTALRM && sig != SIGALRM) 48 sig != SIGVTALRM && sig != SIGALRM)
50 unblock_signals(); 49 unblock_signals();
51 50
52 handler(sig, (union uml_pt_regs *) r); 51 handler(sig, r);
53 52
54 errno = save_errno; 53 errno = save_errno;
55 r->is_user = save_user; 54 r->skas.is_user = save_user;
56} 55}
57 56
58extern int ptrace_faultinfo; 57extern int ptrace_faultinfo;