Path: blob/master/arch/microblaze/include/asm/exceptions.h
15126 views
/*1* Preliminary support for HW exception handing for Microblaze2*3* Copyright (C) 2008-2009 Michal Simek <[email protected]>4* Copyright (C) 2008-2009 PetaLogix5* Copyright (C) 2005 John Williams <[email protected]>6*7* This file is subject to the terms and conditions of the GNU General8* Public License. See the file COPYING in the main directory of this9* archive for more details.10*/1112#ifndef _ASM_MICROBLAZE_EXCEPTIONS_H13#define _ASM_MICROBLAZE_EXCEPTIONS_H1415#ifdef __KERNEL__1617#ifndef CONFIG_MMU18#define EX_HANDLER_STACK_SIZ (4*19)19#endif2021#ifndef __ASSEMBLY__2223/* Macros to enable and disable HW exceptions in the MSR */24/* Define MSR enable bit for HW exceptions */25#define HWEX_MSR_BIT (1 << 8)2627#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR28#define __enable_hw_exceptions() \29__asm__ __volatile__ (" msrset r0, %0; \30nop;" \31: \32: "i" (HWEX_MSR_BIT) \33: "memory")3435#define __disable_hw_exceptions() \36__asm__ __volatile__ (" msrclr r0, %0; \37nop;" \38: \39: "i" (HWEX_MSR_BIT) \40: "memory")41#else /* !CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */42#define __enable_hw_exceptions() \43__asm__ __volatile__ (" \44mfs r12, rmsr; \45nop; \46ori r12, r12, %0; \47mts rmsr, r12; \48nop;" \49: \50: "i" (HWEX_MSR_BIT) \51: "memory", "r12")5253#define __disable_hw_exceptions() \54__asm__ __volatile__ (" \55mfs r12, rmsr; \56nop; \57andi r12, r12, ~%0; \58mts rmsr, r12; \59nop;" \60: \61: "i" (HWEX_MSR_BIT) \62: "memory", "r12")63#endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */6465asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,66int fsr, int addr);6768asmlinkage void sw_exception(struct pt_regs *regs);69void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig);7071void die(const char *str, struct pt_regs *fp, long err);72void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr);7374#endif /*__ASSEMBLY__ */75#endif /* __KERNEL__ */76#endif /* _ASM_MICROBLAZE_EXCEPTIONS_H */777879