]>
Commit | Line | Data |
---|---|---|
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 | // The package level header files this module uses\r | |
20 | //\r | |
21 | #include <PiDxe.h>\r | |
22 | //\r | |
23 | // The protocols, PPI and GUID defintions for this module\r | |
24 | //\r | |
25 | #include <Protocol/DebugSupport.h>\r | |
26 | #include <Protocol/LoadedImage.h>\r | |
27 | //\r | |
28 | // The Library classes this module consumes\r | |
29 | //\r | |
30 | #include <Library/DebugLib.h>\r | |
31 | #include <Library/UefiDriverEntryPoint.h>\r | |
32 | #include <Library/BaseMemoryLib.h>\r | |
33 | #include <Library/MemoryAllocationLib.h>\r | |
34 | #include <Library/UefiBootServicesTableLib.h>\r | |
35 | #include <Library/BaseLib.h>\r | |
36 | #include <Library/PcdLib.h>\r | |
37 | \r | |
38 | #define DISABLE_INTERRUPTS 0UL\r | |
39 | \r | |
40 | //\r | |
41 | // The remaining definitions comprise the protocol members.\r | |
42 | //\r | |
43 | #define EFI_ISA IsaIpf\r | |
44 | \r | |
45 | //\r | |
46 | // processor specific functions that must be public\r | |
47 | //\r | |
48 | EFI_STATUS\r | |
49 | plInitializeDebugSupportDriver (\r | |
50 | VOID\r | |
51 | )\r | |
52 | /*++\r | |
53 | \r | |
54 | Routine Description:\r | |
55 | IPF specific DebugSupport driver initialization. Must be public because it's\r | |
56 | referenced from DebugSupport.c\r | |
57 | \r | |
58 | Arguments:\r | |
59 | \r | |
60 | Returns:\r | |
61 | \r | |
62 | EFI_SUCCESS\r | |
63 | \r | |
64 | --*/\r | |
65 | ;\r | |
66 | \r | |
67 | EFI_STATUS\r | |
68 | EFIAPI\r | |
69 | plUnloadDebugSupportDriver (\r | |
70 | IN EFI_HANDLE ImageHandle\r | |
71 | )\r | |
72 | /*++\r | |
73 | \r | |
74 | Routine Description:\r | |
75 | Unload handler that is called during UnloadImage() - deallocates pool memory\r | |
76 | used by the driver. Must be public because it's referenced from DebugSuport.c\r | |
77 | \r | |
78 | Arguments:\r | |
79 | ImageHandle - Image handle\r | |
80 | \r | |
81 | Returns:\r | |
82 | \r | |
83 | EFI_STATUS - anything other than EFI_SUCCESS indicates the callback was not registered.\r | |
84 | \r | |
85 | --*/\r | |
86 | ;\r | |
87 | \r | |
88 | //\r | |
89 | // Assembly worker functions and data referenced from plDebugSupport.c\r | |
90 | //\r | |
91 | VOID *\r | |
92 | GetIva (\r | |
93 | VOID\r | |
94 | )\r | |
95 | /*++\r | |
96 | \r | |
97 | Routine Description:\r | |
98 | \r | |
99 | C callable function to obtain the current value of IVA\r | |
100 | \r | |
101 | Arguments:\r | |
102 | \r | |
103 | None\r | |
104 | \r | |
105 | Returns:\r | |
106 | \r | |
107 | Current value if IVA\r | |
108 | \r | |
109 | --*/\r | |
110 | ;\r | |
111 | \r | |
112 | VOID\r | |
113 | HookStub (\r | |
114 | VOID\r | |
115 | )\r | |
116 | /*++\r | |
117 | \r | |
118 | Routine Description:\r | |
119 | \r | |
120 | HookStub will be copied from it's loaded location into the IVT when\r | |
121 | an IVT entry is hooked.\r | |
122 | \r | |
123 | Arguments:\r | |
124 | \r | |
125 | None\r | |
126 | \r | |
127 | Returns:\r | |
128 | \r | |
129 | None\r | |
130 | \r | |
131 | --*/\r | |
132 | ;\r | |
133 | \r | |
134 | VOID\r | |
135 | ChainHandler (\r | |
136 | VOID\r | |
137 | )\r | |
138 | /*++\r | |
139 | \r | |
140 | Routine Description:\r | |
141 | \r | |
142 | Chains an interrupt handler\r | |
143 | \r | |
144 | Arguments:\r | |
145 | \r | |
146 | None\r | |
147 | \r | |
148 | Returns:\r | |
149 | \r | |
150 | None\r | |
151 | \r | |
152 | --*/\r | |
153 | ;\r | |
154 | \r | |
155 | VOID\r | |
156 | UnchainHandler (\r | |
157 | VOID\r | |
158 | )\r | |
159 | /*++\r | |
160 | \r | |
161 | Routine Description:\r | |
162 | \r | |
163 | Unchains an interrupt handler\r | |
164 | \r | |
165 | Arguments:\r | |
166 | \r | |
167 | None\r | |
168 | \r | |
169 | Returns:\r | |
170 | \r | |
171 | None\r | |
172 | \r | |
173 | --*/\r | |
174 | ;\r | |
175 | \r | |
176 | UINT64\r | |
177 | ProgramInterruptFlags (\r | |
178 | IN UINT64 NewInterruptState\r | |
179 | )\r | |
180 | /*++\r | |
181 | \r | |
182 | Routine Description:\r | |
183 | \r | |
184 | C callable function to enable/disable interrupts\r | |
185 | \r | |
186 | Arguments:\r | |
187 | \r | |
188 | NewInterruptState - New Interrupt State\r | |
189 | \r | |
190 | Returns:\r | |
191 | \r | |
192 | Previous state of psr.ic\r | |
193 | \r | |
194 | --*/\r | |
195 | ;\r | |
196 | \r | |
197 | VOID\r | |
198 | InstructionCacheFlush (\r | |
199 | IN VOID *StartAddress,\r | |
200 | IN UINTN SizeInBytes\r | |
201 | )\r | |
202 | /*++\r | |
203 | \r | |
204 | Routine Description:\r | |
205 | \r | |
206 | Flushes instruction cache for specified number of bytes\r | |
207 | \r | |
208 | Arguments:\r | |
209 | \r | |
210 | StartAddress - Cache Start Address\r | |
211 | SizeInBytes - Cache Size\r | |
212 | \r | |
213 | Returns:\r | |
214 | \r | |
215 | None\r | |
216 | \r | |
217 | --*/\r | |
218 | ;\r | |
219 | \r | |
220 | EFI_STATUS\r | |
221 | EFIAPI\r | |
222 | GetMaximumProcessorIndex (\r | |
223 | IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r | |
224 | OUT UINTN *MaxProcessorIndex\r | |
225 | )\r | |
226 | /*++\r | |
227 | \r | |
228 | Routine Description: This is a DebugSupport protocol member function. Hard\r | |
229 | coded to support only 1 processor for now.\r | |
230 | \r | |
231 | Arguments:\r | |
232 | This - The DebugSupport instance\r | |
233 | MaxProcessorIndex - The maximuim supported processor index\r | |
234 | \r | |
235 | Returns:\r | |
236 | Always returns EFI_SUCCESS with *MaxProcessorIndex set to 0\r | |
237 | \r | |
238 | --*/\r | |
239 | ;\r | |
240 | \r | |
241 | EFI_STATUS\r | |
242 | EFIAPI\r | |
243 | RegisterPeriodicCallback (\r | |
244 | IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r | |
245 | IN UINTN ProcessorIndex,\r | |
246 | IN EFI_PERIODIC_CALLBACK PeriodicCallback\r | |
247 | )\r | |
248 | /*++\r | |
249 | \r | |
250 | Routine Description:\r | |
251 | DebugSupport protocol member function\r | |
252 | \r | |
253 | Arguments:\r | |
254 | This - The DebugSupport instance\r | |
255 | ProcessorIndex - Which processor the callback applies to.\r | |
256 | PeriodicCallback - Callback function\r | |
257 | \r | |
258 | Returns:\r | |
259 | \r | |
260 | EFI_STATUS - anything other than EFI_SUCCESS indicates the callback was not registered.\r | |
261 | \r | |
262 | --*/\r | |
263 | ;\r | |
264 | \r | |
265 | EFI_STATUS\r | |
266 | EFIAPI\r | |
267 | RegisterExceptionCallback (\r | |
268 | IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r | |
269 | IN UINTN ProcessorIndex,\r | |
270 | IN EFI_EXCEPTION_CALLBACK NewHandler,\r | |
271 | IN EFI_EXCEPTION_TYPE ExceptionType\r | |
272 | )\r | |
273 | /*++\r | |
274 | \r | |
275 | Routine Description:\r | |
276 | DebugSupport protocol member function\r | |
277 | \r | |
278 | Arguments:\r | |
279 | This - The DebugSupport instance\r | |
280 | ProcessorIndex - Which processor the callback applies to.\r | |
281 | NewCallback - Callback function\r | |
282 | ExceptionType - Which exception to hook\r | |
283 | \r | |
284 | Returns:\r | |
285 | \r | |
286 | EFI_STATUS - anything other than EFI_SUCCESS indicates the callback was not registered.\r | |
287 | \r | |
288 | --*/\r | |
289 | ;\r | |
290 | \r | |
291 | EFI_STATUS\r | |
292 | EFIAPI\r | |
293 | InvalidateInstructionCache (\r | |
294 | IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r | |
295 | IN UINTN ProcessorIndex,\r | |
296 | IN VOID *Start,\r | |
297 | IN UINTN Length\r | |
298 | )\r | |
299 | /*++\r | |
300 | \r | |
301 | Routine Description:\r | |
302 | DebugSupport protocol member function. Calls assembly routine to flush cache.\r | |
303 | \r | |
304 | Arguments:\r | |
305 | This - The DebugSupport instance\r | |
306 | ProcessorIndex - Which processor the callback applies to.\r | |
307 | Start - Physical base of the memory range to be invalidated\r | |
308 | Length - mininum number of bytes in instruction cache to invalidate\r | |
309 | \r | |
310 | Returns:\r | |
311 | EFI_SUCCESS\r | |
312 | \r | |
313 | --*/\r | |
314 | ;\r | |
315 | \r | |
316 | VOID\r | |
317 | CommonHandler (\r | |
318 | IN EFI_EXCEPTION_TYPE ExceptionType,\r | |
319 | IN EFI_SYSTEM_CONTEXT Context\r | |
320 | )\r | |
321 | /*++\r | |
322 | \r | |
323 | Routine Description:\r | |
324 | C routine that is called for all registered exceptions. This is the main\r | |
325 | exception dispatcher. Must be public because it's referenced from AsmFuncs.s.\r | |
326 | \r | |
327 | Arguments:\r | |
328 | ExceptionType - Exception Type\r | |
329 | Context - System Context\r | |
330 | \r | |
331 | Returns:\r | |
332 | \r | |
333 | Nothing\r | |
334 | \r | |
335 | --*/\r | |
336 | ;\r | |
337 | \r | |
338 | #endif\r |