1 | /****************************************************************************** |
---|
2 | * Copyright (c) 2009 - 2021 Xilinx, Inc. All rights reserved. |
---|
3 | * SPDX-License-Identifier: MIT |
---|
4 | ******************************************************************************/ |
---|
5 | |
---|
6 | /*****************************************************************************/ |
---|
7 | /** |
---|
8 | * |
---|
9 | * @file xil_exception.h |
---|
10 | * |
---|
11 | * @addtogroup microblaze_exception_apis Microblaze Exception APIs |
---|
12 | * @{ |
---|
13 | * |
---|
14 | * The xil_exception.h file, available in the <install-directory>/src/microblaze folder, |
---|
15 | * contains Microblaze specific exception related APIs and macros. Application programs |
---|
16 | * can use these APIs for various exception related operations. For example, enable exception, |
---|
17 | * disable exception, register exception hander. |
---|
18 | * |
---|
19 | * @note To use exception related functions, xil_exception.h must be added in source code |
---|
20 | * |
---|
21 | * |
---|
22 | * <pre> |
---|
23 | * MODIFICATION HISTORY: |
---|
24 | * |
---|
25 | * Ver Who Date Changes |
---|
26 | * ----- ---- -------- ------------------------------------------------------- |
---|
27 | * 1.00 hbm 07/28/09 Initial release |
---|
28 | * |
---|
29 | * </pre> |
---|
30 | * |
---|
31 | ******************************************************************************/ |
---|
32 | |
---|
33 | /** |
---|
34 | *@cond nocomments |
---|
35 | */ |
---|
36 | #ifndef XIL_EXCEPTION_H /* prevent circular inclusions */ |
---|
37 | #define XIL_EXCEPTION_H /* by using protection macros */ |
---|
38 | |
---|
39 | #include "xil_types.h" |
---|
40 | |
---|
41 | #ifdef __cplusplus |
---|
42 | extern "C" { |
---|
43 | #endif |
---|
44 | |
---|
45 | /************************** Constant Definitions *****************************/ |
---|
46 | |
---|
47 | /* |
---|
48 | * These constants are specific to Microblaze processor. |
---|
49 | */ |
---|
50 | |
---|
51 | #define XIL_EXCEPTION_ID_FIRST 0U |
---|
52 | #define XIL_EXCEPTION_ID_FSL 0U |
---|
53 | #define XIL_EXCEPTION_ID_UNALIGNED_ACCESS 1U |
---|
54 | #define XIL_EXCEPTION_ID_ILLEGAL_OPCODE 2U |
---|
55 | #define XIL_EXCEPTION_ID_M_AXI_I_EXCEPTION 3U |
---|
56 | #define XIL_EXCEPTION_ID_IPLB_EXCEPTION 3U |
---|
57 | #define XIL_EXCEPTION_ID_M_AXI_D_EXCEPTION 4U |
---|
58 | #define XIL_EXCEPTION_ID_DPLB_EXCEPTION 4U |
---|
59 | #define XIL_EXCEPTION_ID_DIV_BY_ZERO 5U |
---|
60 | #define XIL_EXCEPTION_ID_FPU 6U |
---|
61 | #define XIL_EXCEPTION_ID_STACK_VIOLATION 7U |
---|
62 | #define XIL_EXCEPTION_ID_MMU 7U |
---|
63 | #define XIL_EXCEPTION_ID_LAST XIL_EXCEPTION_ID_MMU |
---|
64 | |
---|
65 | /* |
---|
66 | * XIL_EXCEPTION_ID_INT is defined for all processors, but with different value. |
---|
67 | */ |
---|
68 | #define XIL_EXCEPTION_ID_INT 16U /** |
---|
69 | * exception ID for interrupt |
---|
70 | */ |
---|
71 | |
---|
72 | /**************************** Type Definitions *******************************/ |
---|
73 | |
---|
74 | /** |
---|
75 | * This typedef is the exception handler function. |
---|
76 | */ |
---|
77 | typedef void (*Xil_ExceptionHandler)(void *Data); |
---|
78 | |
---|
79 | /** |
---|
80 | * This data type defines an interrupt handler for a device. |
---|
81 | * The argument points to the instance of the component |
---|
82 | */ |
---|
83 | typedef void (*XInterruptHandler) (void *InstancePtr); |
---|
84 | |
---|
85 | /***************** Macros (Inline Functions) Definitions *********************/ |
---|
86 | |
---|
87 | |
---|
88 | /************************** Function Prototypes ******************************/ |
---|
89 | |
---|
90 | extern void Xil_ExceptionRegisterHandler(u32 Id, |
---|
91 | Xil_ExceptionHandler Handler, |
---|
92 | void *Data); |
---|
93 | |
---|
94 | extern void Xil_ExceptionRemoveHandler(u32 Id); |
---|
95 | |
---|
96 | extern void Xil_ExceptionInit(void); |
---|
97 | extern void Xil_ExceptionEnable(void); |
---|
98 | extern void Xil_ExceptionDisable(void); |
---|
99 | |
---|
100 | #ifdef __cplusplus |
---|
101 | } |
---|
102 | #endif |
---|
103 | |
---|
104 | #endif |
---|
105 | |
---|
106 | /** |
---|
107 | *@endcond |
---|
108 | */ |
---|
109 | |
---|
110 | /** |
---|
111 | * @} End of "addtogroup microblaze_exception_apis". |
---|
112 | */ |
---|