26 #include <linux/kernel.h>
27 #include <linux/sched.h>
29 #include <linux/module.h>
35 #include <asm/ptrace.h>
36 #include <asm/timex.h>
37 #include <asm/uaccess.h>
38 #include <asm/pgtable.h>
39 #include <asm/processor.h>
43 extern int return_from_debug_flag;
78 #define COPROCESSOR(x) \
79 { EXCCAUSE_COPROCESSOR ## x ## _DISABLED, USER, fast_coprocessor }
99 #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION
100 #ifdef CONFIG_XTENSA_UNALIGNED_USER
124 #if XTENSA_HAVE_COPROCESSOR(0)
127 #if XTENSA_HAVE_COPROCESSOR(1)
130 #if XTENSA_HAVE_COPROCESSOR(2)
133 #if XTENSA_HAVE_COPROCESSOR(3)
136 #if XTENSA_HAVE_COPROCESSOR(4)
139 #if XTENSA_HAVE_COPROCESSOR(5)
142 #if XTENSA_HAVE_COPROCESSOR(6)
145 #if XTENSA_HAVE_COPROCESSOR(7)
179 printk(
"Caught unhandled exception in '%s' "
180 "(pid = %d, pc = %#010lx) - should not happen\n"
181 "\tEXCCAUSE is %ld\n",
192 die(
"Caught multihit exception", regs,
SIGKILL);
206 unsigned long intenable =
get_sr (intenable);
215 if (mask & (intread & intenable)) {
233 printk(
"Illegal Instruction in '%s' (pid = %d, pc = %#010lx)\n",
246 #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION
247 #ifndef CONFIG_XTENSA_UNALIGNED_USER
257 current->thread.error_code = -3;
258 printk(
"Unaligned memory access to %08lx in '%s' "
259 "(pid = %d, pc = %#010lx)\n",
264 info.si_addr = (
void *) regs->
excvaddr;
283 return_from_debug_flag = 1;
309 #define set_handler(idx,handler) (exc_table[idx] = (unsigned long) (handler))
317 for(i = 0; i < 64; i++) {
325 for(i = 0; dispatch_init_table[
i].
cause >= 0; i++) {
333 if (fast && fast &
USER)
335 if (fast && fast &
KRNL)
342 __asm__ __volatile__(
"wsr %0, excsave1\n" : :
"a" (i));
353 wmask = regs->
wmask & ~1;
355 for (i = 0; i < 16; i++) {
362 printk(
"pc: %08lx, ps: %08lx, depc: %08lx, excvaddr: %08lx\n",
364 printk(
"lbeg: %08lx, lend: %08lx lcount: %08lx, sar: %08lx\n",
367 printk(
"wb: %08lx, ws: %08lx, wmask: %08lx, syscall: %ld\n",
377 __asm__ __volatile__ (
"mov %0, a1\n" :
"=a"(sp));
379 sp = (
unsigned long *)task->
thread.sp;
384 static inline void spill_registers(
void)
393 "movi a0, _spill_registers\n\t"
399 ::
"a" (&a0),
"a" (&ps)
400 :
"a2",
"a3",
"a4",
"a7",
"a11",
"a12",
"a13",
"a14",
"a15",
"memory");
406 unsigned long sp_start, sp_end;
409 a1 = (
unsigned long)sp;
417 #ifdef CONFIG_KALLSYMS
422 while (a1 > sp_start && a1 < sp_end) {
423 sp = (
unsigned long*)a1;
428 if (a1 <= (
unsigned long)
sp)
434 printk(
" [<%08lx>] ", pc);
435 print_symbol(
"%s\n", pc);
451 unsigned long *
stack;
459 for (i = 0; i < kstack_depth_to_print; i++) {
462 if (i && ((i % 8) == 0))
484 for(i = -3 ; i < 6 ; i++) {
487 printk(
" (Bad address in pc)\n");
490 printk(
"%c%08lx%c",(i?
' ':
'<'),insn,(i?
' ':
'>'));
498 static int die_counter;
504 printk(
"%s: sig: %ld [#%d]\n", str, err, ++die_counter);
505 #ifdef CONFIG_PREEMPT
519 panic(
"Fatal exception in interrupt");
522 panic(
"Fatal exception");