aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/traps.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-11-22 13:06:44 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-11-22 13:06:44 -0500
commit0bd2af46839ad6262d25714a6ec0365db9d6b98f (patch)
treedcced72d230d69fd0c5816ac6dd03ab84799a93e /arch/powerpc/kernel/traps.c
parente138a5d2356729b8752e88520cc1525fae9794ac (diff)
parentf26b90440cd74c78fe10c9bd5160809704a9627c (diff)
Merge ../scsi-rc-fixes-2.6
Diffstat (limited to 'arch/powerpc/kernel/traps.c')
-rw-r--r--arch/powerpc/kernel/traps.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index d9f10f2fc372..c66b4771ef44 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -843,7 +843,7 @@ void __kprobes program_check_exception(struct pt_regs *regs)
843 843
844void alignment_exception(struct pt_regs *regs) 844void alignment_exception(struct pt_regs *regs)
845{ 845{
846 int fixed = 0; 846 int sig, code, fixed = 0;
847 847
848 /* we don't implement logging of alignment exceptions */ 848 /* we don't implement logging of alignment exceptions */
849 if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS)) 849 if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS))
@@ -857,14 +857,16 @@ void alignment_exception(struct pt_regs *regs)
857 857
858 /* Operand address was bad */ 858 /* Operand address was bad */
859 if (fixed == -EFAULT) { 859 if (fixed == -EFAULT) {
860 if (user_mode(regs)) 860 sig = SIGSEGV;
861 _exception(SIGSEGV, regs, SEGV_ACCERR, regs->dar); 861 code = SEGV_ACCERR;
862 else 862 } else {
863 /* Search exception table */ 863 sig = SIGBUS;
864 bad_page_fault(regs, regs->dar, SIGSEGV); 864 code = BUS_ADRALN;
865 return;
866 } 865 }
867 _exception(SIGBUS, regs, BUS_ADRALN, regs->dar); 866 if (user_mode(regs))
867 _exception(sig, regs, code, regs->dar);
868 else
869 bad_page_fault(regs, regs->dar, sig);
868} 870}
869 871
870void StackOverflow(struct pt_regs *regs) 872void StackOverflow(struct pt_regs *regs)
@@ -900,14 +902,13 @@ void kernel_fp_unavailable_exception(struct pt_regs *regs)
900 902
901void altivec_unavailable_exception(struct pt_regs *regs) 903void altivec_unavailable_exception(struct pt_regs *regs)
902{ 904{
903#if !defined(CONFIG_ALTIVEC)
904 if (user_mode(regs)) { 905 if (user_mode(regs)) {
905 /* A user program has executed an altivec instruction, 906 /* A user program has executed an altivec instruction,
906 but this kernel doesn't support altivec. */ 907 but this kernel doesn't support altivec. */
907 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); 908 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
908 return; 909 return;
909 } 910 }
910#endif 911
911 printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception " 912 printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception "
912 "%lx at %lx\n", regs->trap, regs->nip); 913 "%lx at %lx\n", regs->trap, regs->nip);
913 die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT); 914 die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT);