2009-03-27 21:25:13 +08:00
|
|
|
/*
|
|
|
|
* Preliminary support for HW exception handing for Microblaze
|
|
|
|
*
|
2009-05-26 22:30:27 +08:00
|
|
|
* Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
|
|
|
|
* Copyright (C) 2008-2009 PetaLogix
|
2009-03-27 21:25:13 +08:00
|
|
|
* 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__
|
2010-04-28 01:37:54 +08:00
|
|
|
|
|
|
|
#ifndef CONFIG_MMU
|
|
|
|
#define EX_HANDLER_STACK_SIZ (4*19)
|
|
|
|
#endif
|
|
|
|
|
2009-03-27 21:25:13 +08:00
|
|
|
#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);
|
|
|
|
|
2011-02-07 18:36:25 +08:00
|
|
|
asmlinkage void sw_exception(struct pt_regs *regs);
|
|
|
|
|
2009-04-16 17:11:22 +08:00
|
|
|
void die(const char *str, struct pt_regs *fp, long err);
|
|
|
|
void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr);
|
|
|
|
|
2009-03-27 21:25:13 +08:00
|
|
|
#endif /*__ASSEMBLY__ */
|
|
|
|
#endif /* __KERNEL__ */
|
|
|
|
#endif /* _ASM_MICROBLAZE_EXCEPTIONS_H */
|