diff options
Diffstat (limited to 'arch/mn10300/kernel/traps.c')
| -rw-r--r-- | arch/mn10300/kernel/traps.c | 42 |
1 files changed, 13 insertions, 29 deletions
diff --git a/arch/mn10300/kernel/traps.c b/arch/mn10300/kernel/traps.c index 91365adba4f5..b90c3f160c77 100644 --- a/arch/mn10300/kernel/traps.c +++ b/arch/mn10300/kernel/traps.c | |||
| @@ -45,9 +45,6 @@ | |||
| 45 | #error "INTERRUPT_VECTOR_BASE not aligned to 16MiB boundary!" | 45 | #error "INTERRUPT_VECTOR_BASE not aligned to 16MiB boundary!" |
| 46 | #endif | 46 | #endif |
| 47 | 47 | ||
| 48 | struct pt_regs *__frame; /* current frame pointer */ | ||
| 49 | EXPORT_SYMBOL(__frame); | ||
| 50 | |||
| 51 | int kstack_depth_to_print = 24; | 48 | int kstack_depth_to_print = 24; |
| 52 | 49 | ||
| 53 | spinlock_t die_lock = __SPIN_LOCK_UNLOCKED(die_lock); | 50 | spinlock_t die_lock = __SPIN_LOCK_UNLOCKED(die_lock); |
| @@ -101,7 +98,6 @@ DO_EINFO(SIGILL, {}, "invalid opcode", invalid_op, ILL_ILLOPC); | |||
| 101 | DO_EINFO(SIGILL, {}, "invalid ex opcode", invalid_exop, ILL_ILLOPC); | 98 | DO_EINFO(SIGILL, {}, "invalid ex opcode", invalid_exop, ILL_ILLOPC); |
| 102 | DO_EINFO(SIGBUS, {}, "invalid address", mem_error, BUS_ADRERR); | 99 | DO_EINFO(SIGBUS, {}, "invalid address", mem_error, BUS_ADRERR); |
| 103 | DO_EINFO(SIGBUS, {}, "bus error", bus_error, BUS_ADRERR); | 100 | DO_EINFO(SIGBUS, {}, "bus error", bus_error, BUS_ADRERR); |
| 104 | DO_EINFO(SIGILL, {}, "FPU invalid opcode", fpu_invalid_op, ILL_COPROC); | ||
| 105 | 101 | ||
| 106 | DO_ERROR(SIGTRAP, | 102 | DO_ERROR(SIGTRAP, |
| 107 | #ifndef CONFIG_MN10300_USING_JTAG | 103 | #ifndef CONFIG_MN10300_USING_JTAG |
| @@ -222,11 +218,14 @@ void show_registers_only(struct pt_regs *regs) | |||
| 222 | printk(KERN_EMERG "threadinfo=%p task=%p)\n", | 218 | printk(KERN_EMERG "threadinfo=%p task=%p)\n", |
| 223 | current_thread_info(), current); | 219 | current_thread_info(), current); |
| 224 | 220 | ||
| 225 | if ((unsigned long) current >= 0x90000000UL && | 221 | if ((unsigned long) current >= PAGE_OFFSET && |
| 226 | (unsigned long) current < 0x94000000UL) | 222 | (unsigned long) current < (unsigned long)high_memory) |
| 227 | printk(KERN_EMERG "Process %s (pid: %d)\n", | 223 | printk(KERN_EMERG "Process %s (pid: %d)\n", |
| 228 | current->comm, current->pid); | 224 | current->comm, current->pid); |
| 229 | 225 | ||
| 226 | #ifdef CONFIG_SMP | ||
| 227 | printk(KERN_EMERG "CPUID: %08x\n", CPUID); | ||
| 228 | #endif | ||
| 230 | printk(KERN_EMERG "CPUP: %04hx\n", CPUP); | 229 | printk(KERN_EMERG "CPUP: %04hx\n", CPUP); |
| 231 | printk(KERN_EMERG "TBR: %08x\n", TBR); | 230 | printk(KERN_EMERG "TBR: %08x\n", TBR); |
| 232 | printk(KERN_EMERG "DEAR: %08x\n", DEAR); | 231 | printk(KERN_EMERG "DEAR: %08x\n", DEAR); |
| @@ -522,8 +521,12 @@ void __init set_intr_stub(enum exception_code code, void *handler) | |||
| 522 | { | 521 | { |
| 523 | unsigned long addr; | 522 | unsigned long addr; |
| 524 | u8 *vector = (u8 *)(CONFIG_INTERRUPT_VECTOR_BASE + code); | 523 | u8 *vector = (u8 *)(CONFIG_INTERRUPT_VECTOR_BASE + code); |
| 524 | unsigned long flags; | ||
| 525 | 525 | ||
| 526 | addr = (unsigned long) handler - (unsigned long) vector; | 526 | addr = (unsigned long) handler - (unsigned long) vector; |
| 527 | |||
| 528 | flags = arch_local_cli_save(); | ||
| 529 | |||
| 527 | vector[0] = 0xdc; /* JMP handler */ | 530 | vector[0] = 0xdc; /* JMP handler */ |
| 528 | vector[1] = addr; | 531 | vector[1] = addr; |
| 529 | vector[2] = addr >> 8; | 532 | vector[2] = addr >> 8; |
| @@ -533,30 +536,12 @@ void __init set_intr_stub(enum exception_code code, void *handler) | |||
| 533 | vector[6] = 0xcb; | 536 | vector[6] = 0xcb; |
| 534 | vector[7] = 0xcb; | 537 | vector[7] = 0xcb; |
| 535 | 538 | ||
| 536 | mn10300_dcache_flush_inv(); | 539 | arch_local_irq_restore(flags); |
| 537 | mn10300_icache_inv(); | ||
| 538 | } | ||
| 539 | |||
| 540 | /* | ||
| 541 | * set an interrupt stub to invoke the JTAG unit and then jump to a handler | ||
| 542 | */ | ||
| 543 | void __init set_jtag_stub(enum exception_code code, void *handler) | ||
| 544 | { | ||
| 545 | unsigned long addr; | ||
| 546 | u8 *vector = (u8 *)(CONFIG_INTERRUPT_VECTOR_BASE + code); | ||
| 547 | |||
| 548 | addr = (unsigned long) handler - ((unsigned long) vector + 1); | ||
| 549 | vector[0] = 0xff; /* PI to jump into JTAG debugger */ | ||
| 550 | vector[1] = 0xdc; /* jmp handler */ | ||
| 551 | vector[2] = addr; | ||
| 552 | vector[3] = addr >> 8; | ||
| 553 | vector[4] = addr >> 16; | ||
| 554 | vector[5] = addr >> 24; | ||
| 555 | vector[6] = 0xcb; | ||
| 556 | vector[7] = 0xcb; | ||
| 557 | 540 | ||
| 541 | #ifndef CONFIG_MN10300_CACHE_SNOOP | ||
| 558 | mn10300_dcache_flush_inv(); | 542 | mn10300_dcache_flush_inv(); |
| 559 | flush_icache_range((unsigned long) vector, (unsigned long) vector + 8); | 543 | mn10300_icache_inv(); |
| 544 | #endif | ||
| 560 | } | 545 | } |
| 561 | 546 | ||
| 562 | /* | 547 | /* |
| @@ -581,7 +566,6 @@ void __init trap_init(void) | |||
| 581 | set_excp_vector(EXCEP_PRIVINSACC, insn_acc_error); | 566 | set_excp_vector(EXCEP_PRIVINSACC, insn_acc_error); |
| 582 | set_excp_vector(EXCEP_PRIVDATACC, data_acc_error); | 567 | set_excp_vector(EXCEP_PRIVDATACC, data_acc_error); |
| 583 | set_excp_vector(EXCEP_DATINSACC, insn_acc_error); | 568 | set_excp_vector(EXCEP_DATINSACC, insn_acc_error); |
| 584 | set_excp_vector(EXCEP_FPU_DISABLED, fpu_disabled); | ||
| 585 | set_excp_vector(EXCEP_FPU_UNIMPINS, fpu_invalid_op); | 569 | set_excp_vector(EXCEP_FPU_UNIMPINS, fpu_invalid_op); |
| 586 | set_excp_vector(EXCEP_FPU_OPERATION, fpu_exception); | 570 | set_excp_vector(EXCEP_FPU_OPERATION, fpu_exception); |
| 587 | 571 | ||
