diff options
author | Michal Simek <monstr@monstr.eu> | 2010-08-03 05:45:08 -0400 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2010-08-04 04:45:17 -0400 |
commit | 2d5973cb5ac5d04662f86e19a06a4c52fa4c4ae3 (patch) | |
tree | 21ddc58eed5ccad856fc44dfb0ee794da41d5b16 /arch/microblaze/include | |
parent | 751f1605e03533a6279ccf456e938e9595c7d888 (diff) |
microblaze: Add KGDB support
Kgdb uses brki r16, 0x18 instruction to call
low level _debug_exception function which save
current state to pt_regs and call microblaze_kgdb_break
function. _debug_exception should be called only from
the kernel space. User space calling is not supported
because user application debugging uses different handling.
pt_regs_to_gdb_regs loads additional special registers
which can't be changed
* Enable KGDB in Kconfig
* Remove ancient not-tested KGDB support
* Remove ancient _debug_exception code from entry.S
Only MMU KGDB support is supported.
Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Jason Wessel <jason.wessel@windriver.com>
CC: John Williams <john.williams@petalogix.com>
CC: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
CC: linux-kernel@vger.kernel.org
Acked-by: Jason Wessel <jason.wessel@windriver.com>
Diffstat (limited to 'arch/microblaze/include')
-rw-r--r-- | arch/microblaze/include/asm/exceptions.h | 16 | ||||
-rw-r--r-- | arch/microblaze/include/asm/kgdb.h | 28 |
2 files changed, 28 insertions, 16 deletions
diff --git a/arch/microblaze/include/asm/exceptions.h b/arch/microblaze/include/asm/exceptions.h index fa0e36657fdd..6479097b802b 100644 --- a/arch/microblaze/include/asm/exceptions.h +++ b/arch/microblaze/include/asm/exceptions.h | |||
@@ -69,22 +69,6 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, | |||
69 | void die(const char *str, struct pt_regs *fp, long err); | 69 | void die(const char *str, struct pt_regs *fp, long err); |
70 | void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr); | 70 | void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr); |
71 | 71 | ||
72 | #if defined(CONFIG_KGDB) | ||
73 | void (*debugger)(struct pt_regs *regs); | ||
74 | int (*debugger_bpt)(struct pt_regs *regs); | ||
75 | int (*debugger_sstep)(struct pt_regs *regs); | ||
76 | int (*debugger_iabr_match)(struct pt_regs *regs); | ||
77 | int (*debugger_dabr_match)(struct pt_regs *regs); | ||
78 | void (*debugger_fault_handler)(struct pt_regs *regs); | ||
79 | #else | ||
80 | #define debugger(regs) do { } while (0) | ||
81 | #define debugger_bpt(regs) 0 | ||
82 | #define debugger_sstep(regs) 0 | ||
83 | #define debugger_iabr_match(regs) 0 | ||
84 | #define debugger_dabr_match(regs) 0 | ||
85 | #define debugger_fault_handler ((void (*)(struct pt_regs *))0) | ||
86 | #endif | ||
87 | |||
88 | #endif /*__ASSEMBLY__ */ | 72 | #endif /*__ASSEMBLY__ */ |
89 | #endif /* __KERNEL__ */ | 73 | #endif /* __KERNEL__ */ |
90 | #endif /* _ASM_MICROBLAZE_EXCEPTIONS_H */ | 74 | #endif /* _ASM_MICROBLAZE_EXCEPTIONS_H */ |
diff --git a/arch/microblaze/include/asm/kgdb.h b/arch/microblaze/include/asm/kgdb.h new file mode 100644 index 000000000000..78b17d40b235 --- /dev/null +++ b/arch/microblaze/include/asm/kgdb.h | |||
@@ -0,0 +1,28 @@ | |||
1 | #ifdef __KERNEL__ | ||
2 | #ifndef __MICROBLAZE_KGDB_H__ | ||
3 | #define __MICROBLAZE_KGDB_H__ | ||
4 | |||
5 | #ifndef __ASSEMBLY__ | ||
6 | |||
7 | #define CACHE_FLUSH_IS_SAFE 1 | ||
8 | #define BUFMAX 2048 | ||
9 | |||
10 | /* | ||
11 | * 32 32-bit general purpose registers (r0-r31) | ||
12 | * 6 32-bit special registers (pc, msr, ear, esr, fsr, btr) | ||
13 | * 12 32-bit PVR | ||
14 | * 7 32-bit MMU Regs (redr, rpid, rzpr, rtlbx, rtlbsx, rtlblo, rtlbhi) | ||
15 | * ------ | ||
16 | * 57 registers | ||
17 | */ | ||
18 | #define NUMREGBYTES (57 * 4) | ||
19 | |||
20 | #define BREAK_INSTR_SIZE 4 | ||
21 | static inline void arch_kgdb_breakpoint(void) | ||
22 | { | ||
23 | __asm__ __volatile__("brki r16, 0x18;"); | ||
24 | } | ||
25 | |||
26 | #endif /* __ASSEMBLY__ */ | ||
27 | #endif /* __MICROBLAZE_KGDB_H__ */ | ||
28 | #endif /* __KERNEL__ */ | ||