2 * Preliminary support for HW exception handing for Microblaze
4 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2008-2009 PetaLogix
6 * Copyright (C) 2005 John Williams <jwilliams@itee.uq.edu.au>
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this
10 * archive for more details.
13 #ifndef _ASM_MICROBLAZE_EXCEPTIONS_H
14 #define _ASM_MICROBLAZE_EXCEPTIONS_H
19 /* Macros to enable and disable HW exceptions in the MSR */
20 /* Define MSR enable bit for HW exceptions */
21 #define HWEX_MSR_BIT (1 << 8)
23 #if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
24 #define __enable_hw_exceptions() \
25 __asm__ __volatile__ (" msrset r0, %0; \
28 : "i" (HWEX_MSR_BIT) \
31 #define __disable_hw_exceptions() \
32 __asm__ __volatile__ (" msrclr r0, %0; \
35 : "i" (HWEX_MSR_BIT) \
37 #else /* !CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
38 #define __enable_hw_exceptions() \
39 __asm__ __volatile__ (" \
46 : "i" (HWEX_MSR_BIT) \
49 #define __disable_hw_exceptions() \
50 __asm__ __volatile__ (" \
57 : "i" (HWEX_MSR_BIT) \
59 #endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
61 asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
64 void die(const char *str, struct pt_regs *fp, long err);
65 void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr);
68 void __bug(const char *file, int line, void *data);
69 int bad_trap(int trap_num, struct pt_regs *regs);
70 int debug_trap(struct pt_regs *regs);
71 #endif /* CONFIG_MMU */
73 #if defined(CONFIG_KGDB)
74 void (*debugger)(struct pt_regs *regs);
75 int (*debugger_bpt)(struct pt_regs *regs);
76 int (*debugger_sstep)(struct pt_regs *regs);
77 int (*debugger_iabr_match)(struct pt_regs *regs);
78 int (*debugger_dabr_match)(struct pt_regs *regs);
79 void (*debugger_fault_handler)(struct pt_regs *regs);
81 #define debugger(regs) do { } while (0)
82 #define debugger_bpt(regs) 0
83 #define debugger_sstep(regs) 0
84 #define debugger_iabr_match(regs) 0
85 #define debugger_dabr_match(regs) 0
86 #define debugger_fault_handler ((void (*)(struct pt_regs *))0)
89 #endif /*__ASSEMBLY__ */
90 #endif /* __KERNEL__ */
91 #endif /* _ASM_MICROBLAZE_EXCEPTIONS_H */