diff options
Diffstat (limited to 'arch/microblaze/kernel/exceptions.c')
| -rw-r--r-- | arch/microblaze/kernel/exceptions.c | 25 | 
1 files changed, 7 insertions, 18 deletions
| diff --git a/arch/microblaze/kernel/exceptions.c b/arch/microblaze/kernel/exceptions.c index b98ee8d0c1cd..478f2943ede7 100644 --- a/arch/microblaze/kernel/exceptions.c +++ b/arch/microblaze/kernel/exceptions.c | |||
| @@ -72,7 +72,6 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, | |||
| 72 | int fsr, int addr) | 72 | int fsr, int addr) | 
| 73 | { | 73 | { | 
| 74 | #ifdef CONFIG_MMU | 74 | #ifdef CONFIG_MMU | 
| 75 | int code; | ||
| 76 | addr = regs->pc; | 75 | addr = regs->pc; | 
| 77 | #endif | 76 | #endif | 
| 78 | 77 | ||
| @@ -86,8 +85,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, | |||
| 86 | switch (type & 0x1F) { | 85 | switch (type & 0x1F) { | 
| 87 | case MICROBLAZE_ILL_OPCODE_EXCEPTION: | 86 | case MICROBLAZE_ILL_OPCODE_EXCEPTION: | 
| 88 | if (user_mode(regs)) { | 87 | if (user_mode(regs)) { | 
| 89 | pr_debug(KERN_WARNING "Illegal opcode exception " \ | 88 | pr_debug("Illegal opcode exception in user mode\n"); | 
| 90 | "in user mode.\n"); | ||
| 91 | _exception(SIGILL, regs, ILL_ILLOPC, addr); | 89 | _exception(SIGILL, regs, ILL_ILLOPC, addr); | 
| 92 | return; | 90 | return; | 
| 93 | } | 91 | } | 
| @@ -97,8 +95,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, | |||
| 97 | break; | 95 | break; | 
| 98 | case MICROBLAZE_IBUS_EXCEPTION: | 96 | case MICROBLAZE_IBUS_EXCEPTION: | 
| 99 | if (user_mode(regs)) { | 97 | if (user_mode(regs)) { | 
| 100 | pr_debug(KERN_WARNING "Instruction bus error " \ | 98 | pr_debug("Instruction bus error exception in user mode\n"); | 
| 101 | "exception in user mode.\n"); | ||
| 102 | _exception(SIGBUS, regs, BUS_ADRERR, addr); | 99 | _exception(SIGBUS, regs, BUS_ADRERR, addr); | 
| 103 | return; | 100 | return; | 
| 104 | } | 101 | } | 
| @@ -108,8 +105,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, | |||
| 108 | break; | 105 | break; | 
| 109 | case MICROBLAZE_DBUS_EXCEPTION: | 106 | case MICROBLAZE_DBUS_EXCEPTION: | 
| 110 | if (user_mode(regs)) { | 107 | if (user_mode(regs)) { | 
| 111 | pr_debug(KERN_WARNING "Data bus error exception " \ | 108 | pr_debug("Data bus error exception in user mode\n"); | 
| 112 | "in user mode.\n"); | ||
| 113 | _exception(SIGBUS, regs, BUS_ADRERR, addr); | 109 | _exception(SIGBUS, regs, BUS_ADRERR, addr); | 
| 114 | return; | 110 | return; | 
| 115 | } | 111 | } | 
| @@ -119,8 +115,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, | |||
| 119 | break; | 115 | break; | 
| 120 | case MICROBLAZE_DIV_ZERO_EXCEPTION: | 116 | case MICROBLAZE_DIV_ZERO_EXCEPTION: | 
| 121 | if (user_mode(regs)) { | 117 | if (user_mode(regs)) { | 
| 122 | pr_debug(KERN_WARNING "Divide by zero exception " \ | 118 | pr_debug("Divide by zero exception in user mode\n"); | 
| 123 | "in user mode\n"); | ||
| 124 | _exception(SIGILL, regs, FPE_INTDIV, addr); | 119 | _exception(SIGILL, regs, FPE_INTDIV, addr); | 
| 125 | return; | 120 | return; | 
| 126 | } | 121 | } | 
| @@ -129,7 +124,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, | |||
| 129 | die("Divide by zero exception", regs, SIGBUS); | 124 | die("Divide by zero exception", regs, SIGBUS); | 
| 130 | break; | 125 | break; | 
| 131 | case MICROBLAZE_FPU_EXCEPTION: | 126 | case MICROBLAZE_FPU_EXCEPTION: | 
| 132 | pr_debug(KERN_WARNING "FPU exception\n"); | 127 | pr_debug("FPU exception\n"); | 
| 133 | /* IEEE FP exception */ | 128 | /* IEEE FP exception */ | 
| 134 | /* I removed fsr variable and use code var for storing fsr */ | 129 | /* I removed fsr variable and use code var for storing fsr */ | 
| 135 | if (fsr & FSR_IO) | 130 | if (fsr & FSR_IO) | 
| @@ -147,14 +142,8 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, | |||
| 147 | 142 | ||
| 148 | #ifdef CONFIG_MMU | 143 | #ifdef CONFIG_MMU | 
| 149 | case MICROBLAZE_PRIVILEGED_EXCEPTION: | 144 | case MICROBLAZE_PRIVILEGED_EXCEPTION: | 
| 150 | pr_debug(KERN_WARNING "Privileged exception\n"); | 145 | pr_debug("Privileged exception\n"); | 
| 151 | /* "brk r0,r0" - used as debug breakpoint - old toolchain */ | 146 | _exception(SIGILL, regs, ILL_PRVOPC, addr); | 
| 152 | if (get_user(code, (unsigned long *)regs->pc) == 0 | ||
| 153 | && code == 0x980c0000) { | ||
| 154 | _exception(SIGTRAP, regs, TRAP_BRKPT, addr); | ||
| 155 | } else { | ||
| 156 | _exception(SIGILL, regs, ILL_PRVOPC, addr); | ||
| 157 | } | ||
| 158 | break; | 147 | break; | 
| 159 | #endif | 148 | #endif | 
| 160 | default: | 149 | default: | 
