exceptions.c (0898782247ae533d1f4e47a06bc5d4870931b284) exceptions.c (05cdf457477d6603b207d91873f0a3d4c7f8c1cd)
1/*
2 * HW exception handling
3 *
4 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2008 PetaLogix
6 *
7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this

--- 55 unchanged lines hidden (view full) ---

64 die("Exception in kernel mode", regs, signr);
65
66 force_sig_fault(signr, code, (void __user *)addr);
67}
68
69asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
70 int fsr, int addr)
71{
1/*
2 * HW exception handling
3 *
4 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2008 PetaLogix
6 *
7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this

--- 55 unchanged lines hidden (view full) ---

64 die("Exception in kernel mode", regs, signr);
65
66 force_sig_fault(signr, code, (void __user *)addr);
67}
68
69asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
70 int fsr, int addr)
71{
72#ifdef CONFIG_MMU
73 addr = regs->pc;
72 addr = regs->pc;
74#endif
75
76#if 0
77 pr_warn("Exception %02x in %s mode, FSR=%08x PC=%08x ESR=%08x\n",
78 type, user_mode(regs) ? "user" : "kernel", fsr,
79 (unsigned int) regs->pc, (unsigned int) regs->esr);
80#endif
81
82 switch (type & 0x1F) {

--- 44 unchanged lines hidden (view full) ---

127 else if (fsr & FSR_UF)
128 fsr = FPE_FLTUND;
129 else if (fsr & FSR_DZ)
130 fsr = FPE_FLTDIV;
131 else if (fsr & FSR_DO)
132 fsr = FPE_FLTRES;
133 _exception(SIGFPE, regs, fsr, addr);
134 break;
73
74#if 0
75 pr_warn("Exception %02x in %s mode, FSR=%08x PC=%08x ESR=%08x\n",
76 type, user_mode(regs) ? "user" : "kernel", fsr,
77 (unsigned int) regs->pc, (unsigned int) regs->esr);
78#endif
79
80 switch (type & 0x1F) {

--- 44 unchanged lines hidden (view full) ---

125 else if (fsr & FSR_UF)
126 fsr = FPE_FLTUND;
127 else if (fsr & FSR_DZ)
128 fsr = FPE_FLTDIV;
129 else if (fsr & FSR_DO)
130 fsr = FPE_FLTRES;
131 _exception(SIGFPE, regs, fsr, addr);
132 break;
135
136#ifdef CONFIG_MMU
137 case MICROBLAZE_PRIVILEGED_EXCEPTION:
138 pr_debug("Privileged exception\n");
139 _exception(SIGILL, regs, ILL_PRVOPC, addr);
140 break;
133 case MICROBLAZE_PRIVILEGED_EXCEPTION:
134 pr_debug("Privileged exception\n");
135 _exception(SIGILL, regs, ILL_PRVOPC, addr);
136 break;
141#endif
142 default:
143 /* FIXME what to do in unexpected exception */
144 pr_warn("Unexpected exception %02x PC=%08x in %s mode\n",
145 type, (unsigned int) addr,
146 kernel_mode(regs) ? "kernel" : "user");
147 }
148 return;
149}
137 default:
138 /* FIXME what to do in unexpected exception */
139 pr_warn("Unexpected exception %02x PC=%08x in %s mode\n",
140 type, (unsigned int) addr,
141 kernel_mode(regs) ? "kernel" : "user");
142 }
143 return;
144}