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