diff options
author | Christoph Hellwig <hch@lst.de> | 2007-05-08 03:27:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:04 -0400 |
commit | 1eeb66a1bb973534dc3d064920a5ca683823372e (patch) | |
tree | 19c22d611e6adefb352dbc107b859e4d13ba38c1 /arch/arm | |
parent | e3869792990f708c97be5877499cada70d469bd3 (diff) |
move die notifier handling to common code
This patch moves the die notifier handling to common code. Previous
various architectures had exactly the same code for it. Note that the new
code is compiled unconditionally, this should be understood as an appel to
the other architecture maintainer to implement support for it aswell (aka
sprinkling a notify_die or two in the proper place)
arm had a notifiy_die that did something totally different, I renamed it to
arm_notify_die as part of the patch and made it static to the file it's
declared and used at. avr32 used to pass slightly less information through
this interface and I brought it into line with the other architectures.
[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: fix vmalloc_sync_all bustage]
[bryan.wu@analog.com: fix vmalloc_sync_all in nommu]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: <linux-arch@vger.kernel.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/kernel/traps.c | 14 | ||||
-rw-r--r-- | arch/arm/mm/fault.c | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index f05e66b0f868..10ff36e4e414 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -245,8 +245,8 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err) | |||
245 | do_exit(SIGSEGV); | 245 | do_exit(SIGSEGV); |
246 | } | 246 | } |
247 | 247 | ||
248 | void notify_die(const char *str, struct pt_regs *regs, struct siginfo *info, | 248 | void arm_notify_die(const char *str, struct pt_regs *regs, |
249 | unsigned long err, unsigned long trap) | 249 | struct siginfo *info, unsigned long err, unsigned long trap) |
250 | { | 250 | { |
251 | if (user_mode(regs)) { | 251 | if (user_mode(regs)) { |
252 | current->thread.error_code = err; | 252 | current->thread.error_code = err; |
@@ -330,7 +330,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs) | |||
330 | info.si_code = ILL_ILLOPC; | 330 | info.si_code = ILL_ILLOPC; |
331 | info.si_addr = pc; | 331 | info.si_addr = pc; |
332 | 332 | ||
333 | notify_die("Oops - undefined instruction", regs, &info, 0, 6); | 333 | arm_notify_die("Oops - undefined instruction", regs, &info, 0, 6); |
334 | } | 334 | } |
335 | 335 | ||
336 | asmlinkage void do_unexp_fiq (struct pt_regs *regs) | 336 | asmlinkage void do_unexp_fiq (struct pt_regs *regs) |
@@ -384,7 +384,7 @@ static int bad_syscall(int n, struct pt_regs *regs) | |||
384 | info.si_addr = (void __user *)instruction_pointer(regs) - | 384 | info.si_addr = (void __user *)instruction_pointer(regs) - |
385 | (thumb_mode(regs) ? 2 : 4); | 385 | (thumb_mode(regs) ? 2 : 4); |
386 | 386 | ||
387 | notify_die("Oops - bad syscall", regs, &info, n, 0); | 387 | arm_notify_die("Oops - bad syscall", regs, &info, n, 0); |
388 | 388 | ||
389 | return regs->ARM_r0; | 389 | return regs->ARM_r0; |
390 | } | 390 | } |
@@ -428,7 +428,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) | |||
428 | info.si_code = SEGV_MAPERR; | 428 | info.si_code = SEGV_MAPERR; |
429 | info.si_addr = NULL; | 429 | info.si_addr = NULL; |
430 | 430 | ||
431 | notify_die("branch through zero", regs, &info, 0, 0); | 431 | arm_notify_die("branch through zero", regs, &info, 0, 0); |
432 | return 0; | 432 | return 0; |
433 | 433 | ||
434 | case NR(breakpoint): /* SWI BREAK_POINT */ | 434 | case NR(breakpoint): /* SWI BREAK_POINT */ |
@@ -564,7 +564,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) | |||
564 | info.si_addr = (void __user *)instruction_pointer(regs) - | 564 | info.si_addr = (void __user *)instruction_pointer(regs) - |
565 | (thumb_mode(regs) ? 2 : 4); | 565 | (thumb_mode(regs) ? 2 : 4); |
566 | 566 | ||
567 | notify_die("Oops - bad syscall(2)", regs, &info, no, 0); | 567 | arm_notify_die("Oops - bad syscall(2)", regs, &info, no, 0); |
568 | return 0; | 568 | return 0; |
569 | } | 569 | } |
570 | 570 | ||
@@ -638,7 +638,7 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs) | |||
638 | info.si_code = ILL_ILLOPC; | 638 | info.si_code = ILL_ILLOPC; |
639 | info.si_addr = (void __user *)addr; | 639 | info.si_addr = (void __user *)addr; |
640 | 640 | ||
641 | notify_die("unknown data abort code", regs, &info, instr, 0); | 641 | arm_notify_die("unknown data abort code", regs, &info, instr, 0); |
642 | } | 642 | } |
643 | 643 | ||
644 | void __attribute__((noreturn)) __bug(const char *file, int line) | 644 | void __attribute__((noreturn)) __bug(const char *file, int line) |
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 5d9ce7deb4a7..75d491448e45 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c | |||
@@ -453,7 +453,7 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
453 | info.si_errno = 0; | 453 | info.si_errno = 0; |
454 | info.si_code = inf->code; | 454 | info.si_code = inf->code; |
455 | info.si_addr = (void __user *)addr; | 455 | info.si_addr = (void __user *)addr; |
456 | notify_die("", regs, &info, fsr, 0); | 456 | arm_notify_die("", regs, &info, fsr, 0); |
457 | } | 457 | } |
458 | 458 | ||
459 | asmlinkage void __exception | 459 | asmlinkage void __exception |