From 70f4cc29350222ff6baf70265f6482fc01565d48 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Sun, 10 May 2009 14:26:52 +0000 Subject: microblaze: kill incorrect __bad_xchg definition The whole point of the __bad_xchg declaration in system.h is to give a linker error when a variable of invalid size is passed to __xchg. The out of line definition in traps.c defeats this purpose and does not any value, so remove it here. Signed-off-by: Arnd Bergmann Signed-off-by: Michal Simek --- arch/microblaze/kernel/traps.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'arch/microblaze/kernel/traps.c') diff --git a/arch/microblaze/kernel/traps.c b/arch/microblaze/kernel/traps.c index 293ef486013..6322cc17447 100644 --- a/arch/microblaze/kernel/traps.c +++ b/arch/microblaze/kernel/traps.c @@ -22,14 +22,6 @@ void trap_init(void) __enable_hw_exceptions(); } -void __bad_xchg(volatile void *ptr, int size) -{ - printk(KERN_INFO "xchg: bad data size: pc 0x%p, ptr 0x%p, size %d\n", - __builtin_return_address(0), ptr, size); - BUG(); -} -EXPORT_SYMBOL(__bad_xchg); - static int kstack_depth_to_print = 24; static int __init kstack_setup(char *s) -- cgit From 17f3324c3eb271882b9e6b8fc3b1698290121801 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 26 May 2009 16:30:27 +0200 Subject: microblaze_mmu_v2: Traps MMU update Signed-off-by: Michal Simek --- arch/microblaze/kernel/traps.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'arch/microblaze/kernel/traps.c') diff --git a/arch/microblaze/kernel/traps.c b/arch/microblaze/kernel/traps.c index 6322cc17447..eaaaf805f31 100644 --- a/arch/microblaze/kernel/traps.c +++ b/arch/microblaze/kernel/traps.c @@ -97,3 +97,37 @@ void dump_stack(void) show_stack(NULL, NULL); } EXPORT_SYMBOL(dump_stack); + +#ifdef CONFIG_MMU +void __bug(const char *file, int line, void *data) +{ + if (data) + printk(KERN_CRIT "kernel BUG at %s:%d (data = %p)!\n", + file, line, data); + else + printk(KERN_CRIT "kernel BUG at %s:%d!\n", file, line); + + machine_halt(); +} + +int bad_trap(int trap_num, struct pt_regs *regs) +{ + printk(KERN_CRIT + "unimplemented trap %d called at 0x%08lx, pid %d!\n", + trap_num, regs->pc, current->pid); + return -ENOSYS; +} + +int debug_trap(struct pt_regs *regs) +{ + int i; + printk(KERN_CRIT "debug trap\n"); + for (i = 0; i < 32; i++) { + /* printk("r%i:%08X\t",i,regs->gpr[i]); */ + if ((i % 4) == 3) + printk(KERN_CRIT "\n"); + } + printk(KERN_CRIT "pc:%08lX\tmsr:%08lX\n", regs->pc, regs->msr); + return -ENOSYS; +} +#endif -- cgit