GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / cfe / cfe / arch / arm / common / include / exception.h
blobefe386b0ee153b7c63ef867e38bae3d8eea77255
1 /* *********************************************************************
2 * Broadcom Common Firmware Environment (CFE)
3 *
4 * Exception/trap handler defs File: exception.h
5 *
6 * This module describes the exception handlers, exception
7 * trap frames, and dispatch.
8 *
9 * Author: Mitch Lichtenberg (mpl@broadcom.com)
11 *********************************************************************
13 * Copyright 2000,2001,2002,2003
14 * Broadcom Corporation. All rights reserved.
16 * This software is furnished under license and may be used and
17 * copied only in accordance with the following terms and
18 * conditions. Subject to these conditions, you may download,
19 * copy, install, use, modify and distribute modified or unmodified
20 * copies of this software in source and/or binary form. No title
21 * or ownership is transferred hereby.
23 * 1) Any source code used, modified or distributed must reproduce
24 * and retain this copyright notice and list of conditions
25 * as they appear in the source file.
27 * 2) No right is granted to use any trade name, trademark, or
28 * logo of Broadcom Corporation. The "Broadcom Corporation"
29 * name may not be used to endorse or promote products derived
30 * from this software without the prior written permission of
31 * Broadcom Corporation.
33 * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
34 * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
35 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
36 * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
37 * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
38 * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
39 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
40 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
41 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
42 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
43 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
44 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
45 * THE POSSIBILITY OF SUCH DAMAGE.
46 ********************************************************************* */
48 #ifdef __ASSEMBLER__
49 #define _XAIDX(x) (8*(x))
50 #else
51 #define _XAIDX(x) (x)
52 #endif
55 /* *********************************************************************
56 * Fixed locations of other low-memory objects. We stuff some
57 * important data in the spaces between the vectors.
58 ********************************************************************* */
60 #define CFE_LOCORE_GLOBAL_GP 0x0040 /* our "handle" */
61 #define CFE_LOCORE_GLOBAL_SP 0x0048 /* Stack pointer for exceptions */
62 #define CFE_LOCORE_GLOBAL_K0TMP 0x0050 /* Used by cache error handler */
63 #define CFE_LOCORE_GLOBAL_K1TMP 0x0058 /* Used by cache error handler */
64 #define CFE_LOCORE_GLOBAL_RATMP 0x0060 /* Used by cache error handler */
65 #define CFE_LOCORE_GLOBAL_GPTMP 0x0068 /* Used by cache error handler */
66 #define CFE_LOCORE_GLOBAL_CERRH 0x0070 /* Pointer to cache error handler */
68 #define CFE_LOCORE_GLOBAL_T0TMP 0x0240 /* used by cache error handler */
69 #define CFE_LOCORE_GLOBAL_T1TMP 0x0248 /* used by cache error handler */
70 #define CFE_LOCORE_GLOBAL_T2TMP 0x0250 /* used by cache error handler */
71 #define CFE_LOCORE_GLOBAL_T3TMP 0x0258 /* used by cache error handler */
73 /* *********************************************************************
74 * Offsets into our exception handler table.
75 ********************************************************************* */
77 #define XTYPE_RESET 0
78 #define XTYPE_TLBFILL 8
79 #define XTYPE_XTLBFILL 16
80 #define XTYPE_CACHEERR 24
81 #define XTYPE_EXCEPTION 32
82 #define XTYPE_INTERRUPT 40
83 #define XTYPE_EJTAG 48
85 /* *********************************************************************
86 * Exception frame definitions.
87 ********************************************************************* */
90 * The exception frame is divided up into pieces, representing the different
91 * parts of the processor that the data comes from:
93 * CP0: Words 0..7
94 * Int Regs: Words 8..41
95 * FP Regs: Words 42..73
96 * Total size: 74 words
99 #define EXCEPTION_SIZE _XAIDX(74)
101 #define XCP0_BASE 0
102 #define XGR_BASE 8
103 #define XFR_BASE 42
105 #define _XCP0IDX(x) _XAIDX((x)+XCP0_BASE)
106 #define XCP0_SR _XCP0IDX(0)
107 #define XCP0_CAUSE _XCP0IDX(1)
108 #define XCP0_EPC _XCP0IDX(2)
109 #define XCP0_VADDR _XCP0IDX(3)
110 #define XCP0_PRID _XCP0IDX(4)
112 #define _XGRIDX(x) _XAIDX((x)+XGR_BASE)
113 #define XGR_ZERO _XGRIDX(0)
114 #define XGR_AT _XGRIDX(1)
115 #define XGR_V0 _XGRIDX(2)
116 #define XGR_V1 _XGRIDX(3)
117 #define XGR_A0 _XGRIDX(4)
118 #define XGR_A1 _XGRIDX(5)
119 #define XGR_A2 _XGRIDX(6)
120 #define XGR_A3 _XGRIDX(7)
121 #define XGR_T0 _XGRIDX(8)
122 #define XGR_T1 _XGRIDX(9)
123 #define XGR_T2 _XGRIDX(10)
124 #define XGR_T3 _XGRIDX(11)
125 #define XGR_T4 _XGRIDX(12)
126 #define XGR_T5 _XGRIDX(13)
127 #define XGR_T6 _XGRIDX(14)
128 #define XGR_T7 _XGRIDX(15)
129 #define XGR_S0 _XGRIDX(16)
130 #define XGR_S1 _XGRIDX(17)
131 #define XGR_S2 _XGRIDX(18)
132 #define XGR_S3 _XGRIDX(19)
133 #define XGR_S4 _XGRIDX(20)
134 #define XGR_S5 _XGRIDX(21)
135 #define XGR_S6 _XGRIDX(22)
136 #define XGR_S7 _XGRIDX(23)
137 #define XGR_T8 _XGRIDX(24)
138 #define XGR_T9 _XGRIDX(25)
139 #define XGR_K0 _XGRIDX(26)
140 #define XGR_K1 _XGRIDX(27)
141 #define XGR_GP _XGRIDX(28)
142 #define XGR_SP _XGRIDX(29)
143 #define XGR_FP _XGRIDX(30)
144 #define XGR_RA _XGRIDX(31)
145 #define XGR_LO _XGRIDX(32)
146 #define XGR_HI _XGRIDX(33)
149 #define _XFRIDX(x) _XAIDX((x)+XFR_BASE)
150 #define XR_F0 _XFRIDX(0)
151 #define XR_F1 _XFRIDX(1)
152 #define XR_F2 _XFRIDX(2)
153 #define XR_F3 _XFRIDX(3)
154 #define XR_F4 _XFRIDX(4)
155 #define XR_F5 _XFRIDX(5)
156 #define XR_F6 _XFRIDX(6)
157 #define XR_F7 _XFRIDX(7)
158 #define XR_F8 _XFRIDX(8)
159 #define XR_F9 _XFRIDX(9)
160 #define XR_F10 _XFRIDX(10)
161 #define XR_F11 _XFRIDX(11)
162 #define XR_F12 _XFRIDX(12)
163 #define XR_F13 _XFRIDX(13)
164 #define XR_F14 _XFRIDX(14)
165 #define XR_F15 _XFRIDX(15)
166 #define XR_F16 _XFRIDX(16)
167 #define XR_F17 _XFRIDX(17)
168 #define XR_F18 _XFRIDX(18)
169 #define XR_F19 _XFRIDX(19)
170 #define XR_F20 _XFRIDX(20)
171 #define XR_F21 _XFRIDX(21)
172 #define XR_F22 _XFRIDX(22)
173 #define XR_F23 _XFRIDX(23)
174 #define XR_F24 _XFRIDX(24)
175 #define XR_F25 _XFRIDX(25)
176 #define XR_F26 _XFRIDX(26)
177 #define XR_F27 _XFRIDX(27)
178 #define XR_F28 _XFRIDX(28)
179 #define XR_F29 _XFRIDX(29)
180 #define XR_F30 _XFRIDX(30)
181 #define XR_F31 _XFRIDX(31)
182 #define XR_FCR _XFRIDX(32)
183 #define XR_FID _XFRIDX(33)
186 #ifndef __ASSEMBLER__
188 #include <typedefs.h>
189 #include <hndrte_armtrap.h>
191 extern void _exc_setvector(int vectype, void *vecaddr);
192 extern void _exc_crash_sim(void);
193 extern void _exc_cache_crash_sim(void);
194 extern void _exc_restart(void);
195 extern void _exc_clear_sr_exl(void);
196 extern void _exc_clear_sr_erl(void);
198 extern uint32 hndrte_set_trap(uint32 hook);
199 extern void hndrte_die(uint32 line);
201 void cfe_exception(trap_t *tr);
202 void cfe_setup_exceptions(void);
204 #endif