2d5973cb5a
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>
74 lines
2 KiB
C
74 lines
2 KiB
C
/*
|
|
* Preliminary support for HW exception handing for Microblaze
|
|
*
|
|
* Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
|
|
* Copyright (C) 2008-2009 PetaLogix
|
|
* Copyright (C) 2005 John Williams <jwilliams@itee.uq.edu.au>
|
|
*
|
|
* This file is subject to the terms and conditions of the GNU General
|
|
* Public License. See the file COPYING in the main directory of this
|
|
* archive for more details.
|
|
*/
|
|
|
|
#ifndef _ASM_MICROBLAZE_EXCEPTIONS_H
|
|
#define _ASM_MICROBLAZE_EXCEPTIONS_H
|
|
|
|
#ifdef __KERNEL__
|
|
|
|
#ifndef CONFIG_MMU
|
|
#define EX_HANDLER_STACK_SIZ (4*19)
|
|
#endif
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
/* Macros to enable and disable HW exceptions in the MSR */
|
|
/* Define MSR enable bit for HW exceptions */
|
|
#define HWEX_MSR_BIT (1 << 8)
|
|
|
|
#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
|
|
#define __enable_hw_exceptions() \
|
|
__asm__ __volatile__ (" msrset r0, %0; \
|
|
nop;" \
|
|
: \
|
|
: "i" (HWEX_MSR_BIT) \
|
|
: "memory")
|
|
|
|
#define __disable_hw_exceptions() \
|
|
__asm__ __volatile__ (" msrclr r0, %0; \
|
|
nop;" \
|
|
: \
|
|
: "i" (HWEX_MSR_BIT) \
|
|
: "memory")
|
|
#else /* !CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
|
|
#define __enable_hw_exceptions() \
|
|
__asm__ __volatile__ (" \
|
|
mfs r12, rmsr; \
|
|
nop; \
|
|
ori r12, r12, %0; \
|
|
mts rmsr, r12; \
|
|
nop;" \
|
|
: \
|
|
: "i" (HWEX_MSR_BIT) \
|
|
: "memory", "r12")
|
|
|
|
#define __disable_hw_exceptions() \
|
|
__asm__ __volatile__ (" \
|
|
mfs r12, rmsr; \
|
|
nop; \
|
|
andi r12, r12, ~%0; \
|
|
mts rmsr, r12; \
|
|
nop;" \
|
|
: \
|
|
: "i" (HWEX_MSR_BIT) \
|
|
: "memory", "r12")
|
|
#endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
|
|
|
|
asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
|
|
int fsr, int addr);
|
|
|
|
void die(const char *str, struct pt_regs *fp, long err);
|
|
void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr);
|
|
|
|
#endif /*__ASSEMBLY__ */
|
|
#endif /* __KERNEL__ */
|
|
#endif /* _ASM_MICROBLAZE_EXCEPTIONS_H */
|