1 | /* |
---|
2 | * vectors.h Exception frame related contant and API. |
---|
3 | * |
---|
4 | * This include file describe the data structure and the functions implemented |
---|
5 | * by rtems to handle exceptions. |
---|
6 | * |
---|
7 | * CopyRight (C) 1999 valette@crf.canon.fr |
---|
8 | * |
---|
9 | * The license and distribution terms for this file may be |
---|
10 | * found in found in the file LICENSE in this distribution or at |
---|
11 | * http://www.rtems.com/license/LICENSE. |
---|
12 | * |
---|
13 | * $Id$ |
---|
14 | */ |
---|
15 | #ifndef LIBBSP_POWERPC_SHARED_VECTORS_H |
---|
16 | #define LIBBSP_POWERPC_SHARED_VECTORS_H |
---|
17 | #include <libcpu/raw_exception.h> |
---|
18 | |
---|
19 | /* |
---|
20 | * The callee (high level exception code written in C) |
---|
21 | * will store the Link Registers (return address) at entry r1 + 4 !!!. |
---|
22 | * So let room for it!!!. |
---|
23 | */ |
---|
24 | #define LINK_REGISTER_CALLEE_UPDATE_ROOM 4 |
---|
25 | #define SRR0_FRAME_OFFSET 8 |
---|
26 | #define SRR1_FRAME_OFFSET 12 |
---|
27 | #define EXCEPTION_NUMBER_OFFSET 16 |
---|
28 | #define GPR0_OFFSET 20 |
---|
29 | #define GPR1_OFFSET 24 |
---|
30 | #define GPR2_OFFSET 28 |
---|
31 | #define GPR3_OFFSET 32 |
---|
32 | #define GPR4_OFFSET 36 |
---|
33 | #define GPR5_OFFSET 40 |
---|
34 | #define GPR6_OFFSET 44 |
---|
35 | #define GPR7_OFFSET 48 |
---|
36 | #define GPR8_OFFSET 52 |
---|
37 | #define GPR9_OFFSET 56 |
---|
38 | #define GPR10_OFFSET 60 |
---|
39 | #define GPR11_OFFSET 64 |
---|
40 | #define GPR12_OFFSET 68 |
---|
41 | #define GPR13_OFFSET 72 |
---|
42 | #define GPR14_OFFSET 76 |
---|
43 | #define GPR15_OFFSET 80 |
---|
44 | #define GPR16_OFFSET 84 |
---|
45 | #define GPR17_OFFSET 88 |
---|
46 | #define GPR18_OFFSET 92 |
---|
47 | #define GPR19_OFFSET 96 |
---|
48 | #define GPR20_OFFSET 100 |
---|
49 | #define GPR21_OFFSET 104 |
---|
50 | #define GPR22_OFFSET 108 |
---|
51 | #define GPR23_OFFSET 112 |
---|
52 | #define GPR24_OFFSET 116 |
---|
53 | #define GPR25_OFFSET 120 |
---|
54 | #define GPR26_OFFSET 124 |
---|
55 | #define GPR27_OFFSET 128 |
---|
56 | #define GPR28_OFFSET 132 |
---|
57 | #define GPR29_OFFSET 136 |
---|
58 | #define GPR30_OFFSET 140 |
---|
59 | #define GPR31_OFFSET 144 |
---|
60 | #define EXC_CR_OFFSET 148 |
---|
61 | #define EXC_CTR_OFFSET 152 |
---|
62 | #define EXC_XER_OFFSET 156 |
---|
63 | #define EXC_LR_OFFSET 160 |
---|
64 | #define EXC_MSR_OFFSET 164 |
---|
65 | #define EXC_DAR_OFFSET 168 |
---|
66 | /* |
---|
67 | * maintain the EABI requested 8 bytes aligment |
---|
68 | * As SVR4 ABI requires 16, make it 16 (as some |
---|
69 | * exception may need more registers to be processed...) |
---|
70 | */ |
---|
71 | #define EXCEPTION_FRAME_END 176 |
---|
72 | |
---|
73 | #ifndef ASM |
---|
74 | /* |
---|
75 | * default raw exception handlers |
---|
76 | * The "*_size" symbol is generated by the linker; prevent it from |
---|
77 | * being accessed in one of the short data areas by declaring |
---|
78 | * it as an array |
---|
79 | */ |
---|
80 | |
---|
81 | extern void default_exception_vector_code_prolog(); |
---|
82 | extern unsigned int default_exception_vector_code_prolog_size[]; |
---|
83 | extern void tgpr_clr_exception_vector_code_prolog(); |
---|
84 | extern unsigned int tgpr_clr_exception_vector_code_prolog_size[]; |
---|
85 | /* |
---|
86 | * FIXME: these should move to a "irq_asm.h" |
---|
87 | */ |
---|
88 | extern void external_exception_vector_prolog_code(); |
---|
89 | extern unsigned int external_exception_vector_prolog_code_size[]; |
---|
90 | #if defined(ASM_DEC_VECTOR) |
---|
91 | extern void decrementer_exception_vector_prolog_code(); |
---|
92 | extern unsigned int decrementer_exception_vector_prolog_code_size[]; |
---|
93 | #endif |
---|
94 | #if defined(ASM_60X_SYSMGMT_VECTOR) |
---|
95 | extern void sysmgmt_exception_vector_prolog_code(); |
---|
96 | extern unsigned int sysmgmt_exception_vector_prolog_code_size[]; |
---|
97 | #endif |
---|
98 | #if defined(ASM_BOOKE_PIT_VECTOR) |
---|
99 | extern void pit_exception_vector_prolog_code(); |
---|
100 | extern unsigned int pit_exception_vector_prolog_code_size[]; |
---|
101 | #endif |
---|
102 | #if defined(ASM_BOOKE_FIT_VECTOR) |
---|
103 | extern void fit_exception_vector_prolog_code(); |
---|
104 | extern unsigned int fit_exception_vector_prolog_code_size[]; |
---|
105 | #endif |
---|
106 | |
---|
107 | /* codemove is like memmove, but it also gets the cache line size |
---|
108 | * as 4th parameter to synchronize them. If this last parameter is |
---|
109 | * zero, it performs more or less like memmove. No copy is performed if |
---|
110 | * source and destination addresses are equal. However the caches |
---|
111 | * are synchronized. Note that the size is always rounded up to the |
---|
112 | * next mutiple of 4. |
---|
113 | */ |
---|
114 | extern void * codemove(void *, const void *, unsigned int, unsigned long); |
---|
115 | extern void exception_nop_enable(const rtems_raw_except_connect_data* ptr); |
---|
116 | extern int exception_always_enabled(const rtems_raw_except_connect_data* ptr); |
---|
117 | extern void initialize_exceptions(); |
---|
118 | |
---|
119 | typedef struct _BSP_Exception_frame { |
---|
120 | unsigned EXC_SRR0; |
---|
121 | unsigned EXC_SRR1; |
---|
122 | unsigned _EXC_number; |
---|
123 | unsigned GPR0; |
---|
124 | unsigned GPR1; |
---|
125 | unsigned GPR2; |
---|
126 | unsigned GPR3; |
---|
127 | unsigned GPR4; |
---|
128 | unsigned GPR5; |
---|
129 | unsigned GPR6; |
---|
130 | unsigned GPR7; |
---|
131 | unsigned GPR8; |
---|
132 | unsigned GPR9; |
---|
133 | unsigned GPR10; |
---|
134 | unsigned GPR11; |
---|
135 | unsigned GPR12; |
---|
136 | unsigned GPR13; |
---|
137 | unsigned GPR14; |
---|
138 | unsigned GPR15; |
---|
139 | unsigned GPR16; |
---|
140 | unsigned GPR17; |
---|
141 | unsigned GPR18; |
---|
142 | unsigned GPR19; |
---|
143 | unsigned GPR20; |
---|
144 | unsigned GPR21; |
---|
145 | unsigned GPR22; |
---|
146 | unsigned GPR23; |
---|
147 | unsigned GPR24; |
---|
148 | unsigned GPR25; |
---|
149 | unsigned GPR26; |
---|
150 | unsigned GPR27; |
---|
151 | unsigned GPR28; |
---|
152 | unsigned GPR29; |
---|
153 | unsigned GPR30; |
---|
154 | unsigned GPR31; |
---|
155 | unsigned EXC_CR; |
---|
156 | unsigned EXC_CTR; |
---|
157 | unsigned EXC_XER; |
---|
158 | unsigned EXC_LR; |
---|
159 | unsigned EXC_MSR; |
---|
160 | unsigned EXC_DAR; |
---|
161 | } BSP_Exception_frame; |
---|
162 | |
---|
163 | typedef void (*exception_handler_t) (BSP_Exception_frame* excPtr); |
---|
164 | extern exception_handler_t globalExceptHdl; |
---|
165 | /* |
---|
166 | * Compatibility with pc386 |
---|
167 | */ |
---|
168 | typedef BSP_Exception_frame CPU_Exception_frame; |
---|
169 | typedef exception_handler_t cpuExcHandlerType; |
---|
170 | |
---|
171 | /* |
---|
172 | * dummy functions for exception interface |
---|
173 | */ |
---|
174 | void exception_nop_enable(const rtems_raw_except_connect_data* ptr); |
---|
175 | int exception_always_enabled(const rtems_raw_except_connect_data* ptr); |
---|
176 | |
---|
177 | #endif /* ASM */ |
---|
178 | |
---|
179 | #endif /* LIBBSP_POWERPC_MCP750_VECTORS_H */ |
---|