]>
Commit | Line | Data |
---|---|---|
5fd59c65 | 1 | /**@file\r |
2 | IPF specific debugsupport types, macros, and definitions.\r | |
3 | \r | |
4 | Copyright (c) 2004 - 2006 Intel Corporation \r | |
5 | All rights reserved. This program and the accompanying materials \r | |
6 | are licensed and made available under the terms and conditions of the BSD License \r | |
7 | which accompanies this distribution. The full text of the license may be found at \r | |
8 | http://opensource.org/licenses/bsd-license.php \r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _PLDEBUG_SUPPORT_H\r | |
16 | #define _PLDEBUG_SUPPORT_H\r | |
17 | \r | |
18 | \r | |
19 | #define DISABLE_INTERRUPTS 0UL\r | |
20 | \r | |
21 | //\r | |
22 | // The remaining definitions comprise the protocol members.\r | |
23 | //\r | |
24 | #define EFI_ISA IsaIpf\r | |
25 | \r | |
26 | //\r | |
27 | // processor specific functions that must be public\r | |
28 | //\r | |
29 | EFI_STATUS\r | |
30 | plInitializeDebugSupportDriver (\r | |
31 | VOID\r | |
32 | )\r | |
33 | /*++\r | |
34 | \r | |
35 | Routine Description:\r | |
36 | IPF specific DebugSupport driver initialization. Must be public because it's\r | |
37 | referenced from DebugSupport.c\r | |
38 | \r | |
39 | Arguments:\r | |
40 | \r | |
41 | Returns:\r | |
42 | \r | |
43 | EFI_SUCCESS\r | |
44 | \r | |
45 | --*/\r | |
46 | ;\r | |
47 | \r | |
48 | EFI_STATUS\r | |
49 | EFIAPI\r | |
50 | plUnloadDebugSupportDriver (\r | |
51 | IN EFI_HANDLE ImageHandle\r | |
52 | )\r | |
53 | /*++\r | |
54 | \r | |
55 | Routine Description:\r | |
56 | Unload handler that is called during UnloadImage() - deallocates pool memory\r | |
57 | used by the driver. Must be public because it's referenced from DebugSuport.c\r | |
58 | \r | |
59 | Arguments:\r | |
60 | ImageHandle - Image handle\r | |
61 | \r | |
62 | Returns:\r | |
63 | \r | |
64 | EFI_STATUS - anything other than EFI_SUCCESS indicates the callback was not registered.\r | |
65 | \r | |
66 | --*/\r | |
67 | ;\r | |
68 | \r | |
69 | //\r | |
70 | // Assembly worker functions and data referenced from plDebugSupport.c\r | |
71 | //\r | |
72 | VOID *\r | |
73 | GetIva (\r | |
74 | VOID\r | |
75 | )\r | |
76 | /*++\r | |
77 | \r | |
78 | Routine Description:\r | |
79 | \r | |
80 | C callable function to obtain the current value of IVA\r | |
81 | \r | |
82 | Arguments:\r | |
83 | \r | |
84 | None\r | |
85 | \r | |
86 | Returns:\r | |
87 | \r | |
88 | Current value if IVA\r | |
89 | \r | |
90 | --*/\r | |
91 | ;\r | |
92 | \r | |
93 | VOID\r | |
94 | HookStub (\r | |
95 | VOID\r | |
96 | )\r | |
97 | /*++\r | |
98 | \r | |
99 | Routine Description:\r | |
100 | \r | |
101 | HookStub will be copied from it's loaded location into the IVT when\r | |
102 | an IVT entry is hooked.\r | |
103 | \r | |
104 | Arguments:\r | |
105 | \r | |
106 | None\r | |
107 | \r | |
108 | Returns:\r | |
109 | \r | |
110 | None\r | |
111 | \r | |
112 | --*/\r | |
113 | ;\r | |
114 | \r | |
115 | VOID\r | |
116 | ChainHandler (\r | |
117 | VOID\r | |
118 | )\r | |
119 | /*++\r | |
120 | \r | |
121 | Routine Description:\r | |
122 | \r | |
123 | Chains an interrupt handler\r | |
124 | \r | |
125 | Arguments:\r | |
126 | \r | |
127 | None\r | |
128 | \r | |
129 | Returns:\r | |
130 | \r | |
131 | None\r | |
132 | \r | |
133 | --*/\r | |
134 | ;\r | |
135 | \r | |
136 | VOID\r | |
137 | UnchainHandler (\r | |
138 | VOID\r | |
139 | )\r | |
140 | /*++\r | |
141 | \r | |
142 | Routine Description:\r | |
143 | \r | |
144 | Unchains an interrupt handler\r | |
145 | \r | |
146 | Arguments:\r | |
147 | \r | |
148 | None\r | |
149 | \r | |
150 | Returns:\r | |
151 | \r | |
152 | None\r | |
153 | \r | |
154 | --*/\r | |
155 | ;\r | |
156 | \r | |
157 | UINT64\r | |
158 | ProgramInterruptFlags (\r | |
159 | IN UINT64 NewInterruptState\r | |
160 | )\r | |
161 | /*++\r | |
162 | \r | |
163 | Routine Description:\r | |
164 | \r | |
165 | C callable function to enable/disable interrupts\r | |
166 | \r | |
167 | Arguments:\r | |
168 | \r | |
169 | NewInterruptState - New Interrupt State\r | |
170 | \r | |
171 | Returns:\r | |
172 | \r | |
173 | Previous state of psr.ic\r | |
174 | \r | |
175 | --*/\r | |
176 | ;\r | |
177 | \r | |
178 | VOID\r | |
179 | InstructionCacheFlush (\r | |
180 | IN VOID *StartAddress,\r | |
181 | IN UINTN SizeInBytes\r | |
182 | )\r | |
183 | /*++\r | |
184 | \r | |
185 | Routine Description:\r | |
186 | \r | |
187 | Flushes instruction cache for specified number of bytes\r | |
188 | \r | |
189 | Arguments:\r | |
190 | \r | |
191 | StartAddress - Cache Start Address\r | |
192 | SizeInBytes - Cache Size\r | |
193 | \r | |
194 | Returns:\r | |
195 | \r | |
196 | None\r | |
197 | \r | |
198 | --*/\r | |
199 | ;\r | |
200 | \r | |
201 | EFI_STATUS\r | |
202 | EFIAPI\r | |
203 | GetMaximumProcessorIndex (\r | |
204 | IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r | |
205 | OUT UINTN *MaxProcessorIndex\r | |
206 | )\r | |
207 | /*++\r | |
208 | \r | |
209 | Routine Description: This is a DebugSupport protocol member function. Hard\r | |
210 | coded to support only 1 processor for now.\r | |
211 | \r | |
212 | Arguments:\r | |
213 | This - The DebugSupport instance\r | |
214 | MaxProcessorIndex - The maximuim supported processor index\r | |
215 | \r | |
216 | Returns:\r | |
217 | Always returns EFI_SUCCESS with *MaxProcessorIndex set to 0\r | |
218 | \r | |
219 | --*/\r | |
220 | ;\r | |
221 | \r | |
222 | EFI_STATUS\r | |
223 | EFIAPI\r | |
224 | RegisterPeriodicCallback (\r | |
225 | IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r | |
226 | IN UINTN ProcessorIndex,\r | |
227 | IN EFI_PERIODIC_CALLBACK PeriodicCallback\r | |
228 | )\r | |
229 | /*++\r | |
230 | \r | |
231 | Routine Description:\r | |
232 | DebugSupport protocol member function\r | |
233 | \r | |
234 | Arguments:\r | |
235 | This - The DebugSupport instance\r | |
236 | ProcessorIndex - Which processor the callback applies to.\r | |
237 | PeriodicCallback - Callback function\r | |
238 | \r | |
239 | Returns:\r | |
240 | \r | |
241 | EFI_STATUS - anything other than EFI_SUCCESS indicates the callback was not registered.\r | |
242 | \r | |
243 | --*/\r | |
244 | ;\r | |
245 | \r | |
246 | EFI_STATUS\r | |
247 | EFIAPI\r | |
248 | RegisterExceptionCallback (\r | |
249 | IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r | |
250 | IN UINTN ProcessorIndex,\r | |
251 | IN EFI_EXCEPTION_CALLBACK NewHandler,\r | |
252 | IN EFI_EXCEPTION_TYPE ExceptionType\r | |
253 | )\r | |
254 | /*++\r | |
255 | \r | |
256 | Routine Description:\r | |
257 | DebugSupport protocol member function\r | |
258 | \r | |
259 | Arguments:\r | |
260 | This - The DebugSupport instance\r | |
261 | ProcessorIndex - Which processor the callback applies to.\r | |
262 | NewCallback - Callback function\r | |
263 | ExceptionType - Which exception to hook\r | |
264 | \r | |
265 | Returns:\r | |
266 | \r | |
267 | EFI_STATUS - anything other than EFI_SUCCESS indicates the callback was not registered.\r | |
268 | \r | |
269 | --*/\r | |
270 | ;\r | |
271 | \r | |
272 | EFI_STATUS\r | |
273 | EFIAPI\r | |
274 | InvalidateInstructionCache (\r | |
275 | IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r | |
276 | IN UINTN ProcessorIndex,\r | |
277 | IN VOID *Start,\r | |
278 | IN UINTN Length\r | |
279 | )\r | |
280 | /*++\r | |
281 | \r | |
282 | Routine Description:\r | |
283 | DebugSupport protocol member function. Calls assembly routine to flush cache.\r | |
284 | \r | |
285 | Arguments:\r | |
286 | This - The DebugSupport instance\r | |
287 | ProcessorIndex - Which processor the callback applies to.\r | |
288 | Start - Physical base of the memory range to be invalidated\r | |
289 | Length - mininum number of bytes in instruction cache to invalidate\r | |
290 | \r | |
291 | Returns:\r | |
292 | EFI_SUCCESS\r | |
293 | \r | |
294 | --*/\r | |
295 | ;\r | |
296 | \r | |
1cc8ee78 | 297 | VOID\r |
298 | CommonHandler (\r | |
299 | IN EFI_EXCEPTION_TYPE ExceptionType,\r | |
300 | IN EFI_SYSTEM_CONTEXT Context\r | |
301 | )\r | |
302 | /*++\r | |
303 | \r | |
304 | Routine Description:\r | |
305 | C routine that is called for all registered exceptions. This is the main\r | |
306 | exception dispatcher. Must be public because it's referenced from AsmFuncs.s.\r | |
307 | \r | |
308 | Arguments:\r | |
309 | ExceptionType - Exception Type\r | |
310 | Context - System Context\r | |
311 | \r | |
312 | Returns:\r | |
313 | \r | |
314 | Nothing\r | |
315 | \r | |
316 | --*/\r | |
317 | ;\r | |
318 | \r | |
5fd59c65 | 319 | #endif\r |