]>
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 | #include <Uefi.h>\r | |
20 | \r | |
21 | #include <Protocol/DebugSupport.h>\r | |
22 | #include <Protocol/LoadedImage.h>\r | |
23 | \r | |
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 | IPF specific DebugSupport driver initialization. \r | |
41 | \r | |
42 | Must be public because it's referenced from DebugSupport.c\r | |
43 | \r | |
44 | @retval EFI_SUCCESS Always.\r | |
45 | \r | |
46 | **/\r | |
47 | EFI_STATUS\r | |
48 | PlInitializeDebugSupportDriver (\r | |
49 | VOID\r | |
50 | );\r | |
51 | \r | |
52 | /**\r | |
53 | Unload handler that is called during UnloadImage() - deallocates pool memory\r | |
54 | used by the driver. Must be public because it's referenced from DebugSuport.c\r | |
55 | \r | |
56 | @param ImageHandle The firmware allocated handle for the EFI image.\r | |
57 | \r | |
58 | @retval EFI_SUCCESS Always.\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 | C callable function to obtain the current value of IVA.\r | |
69 | \r | |
70 | @return Current value of IVA.\r | |
71 | \r | |
72 | **/\r | |
73 | VOID *\r | |
74 | GetIva (\r | |
75 | VOID\r | |
76 | );\r | |
77 | \r | |
78 | /**\r | |
79 | HookStub will be copied from it's loaded location into the IVT when\r | |
80 | an IVT entry is hooked.\r | |
81 | \r | |
82 | **/\r | |
83 | VOID\r | |
84 | HookStub (\r | |
85 | VOID\r | |
86 | );\r | |
87 | \r | |
88 | /**\r | |
89 | Chains an interrupt handler.\r | |
90 | \r | |
91 | **/\r | |
92 | VOID\r | |
93 | ChainHandler (\r | |
94 | VOID\r | |
95 | );\r | |
96 | \r | |
97 | /**\r | |
98 | Unchains an interrupt handler.\r | |
99 | \r | |
100 | **/\r | |
101 | VOID\r | |
102 | UnchainHandler (\r | |
103 | VOID\r | |
104 | );\r | |
105 | \r | |
106 | /**\r | |
107 | C callable function to enable/disable interrupts.\r | |
108 | \r | |
109 | @param NewInterruptState New Interrupt State.\r | |
110 | \r | |
111 | @return Previous state of psr.ic.\r | |
112 | \r | |
113 | **/\r | |
114 | UINT64\r | |
115 | ProgramInterruptFlags (\r | |
116 | IN UINT64 NewInterruptState\r | |
117 | );\r | |
118 | \r | |
119 | /**\r | |
120 | Flushes instruction cache for specified number of bytes.\r | |
121 | \r | |
122 | @param StartAddress Cache Start Address.\r | |
123 | @param SizeInBytes Cache Size.\r | |
124 | \r | |
125 | **/\r | |
126 | VOID\r | |
127 | InstructionCacheFlush (\r | |
128 | IN VOID *StartAddress,\r | |
129 | IN UINTN SizeInBytes\r | |
130 | );\r | |
131 | \r | |
132 | /**\r | |
133 | This is a DebugSupport protocol member function, hard\r | |
134 | coded to support only 1 processor for now.\r | |
135 | \r | |
136 | @param This The DebugSupport instance\r | |
137 | @param MaxProcessorIndex The maximuim supported processor index\r | |
138 | \r | |
139 | @retval EFI_SUCCESS Always returned with **MaxProcessorIndex set to 0.\r | |
140 | \r | |
141 | **/\r | |
142 | EFI_STATUS\r | |
143 | EFIAPI\r | |
144 | GetMaximumProcessorIndex (\r | |
145 | IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r | |
146 | OUT UINTN *MaxProcessorIndex\r | |
147 | );\r | |
148 | \r | |
149 | /**\r | |
150 | DebugSupport protocol member function.\r | |
151 | \r | |
152 | @param This The DebugSupport instance\r | |
153 | @param ProcessorIndex Which processor the callback applies to.\r | |
154 | @param PeriodicCallback Callback function\r | |
155 | \r | |
156 | @retval EFI_SUCCESS Indicates the callback was registered.\r | |
157 | @retval others Callback was not registered.\r | |
158 | \r | |
159 | **/\r | |
160 | EFI_STATUS\r | |
161 | EFIAPI\r | |
162 | RegisterPeriodicCallback (\r | |
163 | IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r | |
164 | IN UINTN ProcessorIndex,\r | |
165 | IN EFI_PERIODIC_CALLBACK PeriodicCallback\r | |
166 | );\r | |
167 | \r | |
168 | /**\r | |
169 | DebugSupport protocol member function.\r | |
170 | \r | |
171 | @param This The DebugSupport instance\r | |
172 | @param ProcessorIndex Which processor the callback applies to.\r | |
173 | @param NewCallback Callback function\r | |
174 | @param ExceptionType Which exception to hook\r | |
175 | \r | |
176 | @retval EFI_SUCCESS Indicates the callback was registered.\r | |
177 | @retval others Callback was not registered.\r | |
178 | \r | |
179 | **/\r | |
180 | EFI_STATUS\r | |
181 | EFIAPI\r | |
182 | RegisterExceptionCallback (\r | |
183 | IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r | |
184 | IN UINTN ProcessorIndex,\r | |
185 | IN EFI_EXCEPTION_CALLBACK NewCallback,\r | |
186 | IN EFI_EXCEPTION_TYPE ExceptionType\r | |
187 | );\r | |
188 | \r | |
189 | /**\r | |
190 | DebugSupport protocol member function. Calls assembly routine to flush cache.\r | |
191 | \r | |
192 | @param This The DebugSupport instance\r | |
193 | @param ProcessorIndex Which processor the callback applies to.\r | |
194 | @param Start Physical base of the memory range to be invalidated\r | |
195 | @param Length mininum number of bytes in instruction cache to invalidate\r | |
196 | \r | |
197 | @retval EFI_SUCCESS Always returned.\r | |
198 | \r | |
199 | **/\r | |
200 | EFI_STATUS\r | |
201 | EFIAPI\r | |
202 | InvalidateInstructionCache (\r | |
203 | IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r | |
204 | IN UINTN ProcessorIndex,\r | |
205 | IN VOID *Start,\r | |
206 | IN UINTN Length\r | |
207 | );\r | |
208 | \r | |
209 | /**\r | |
210 | C routine that is called for all registered exceptions. This is the main\r | |
211 | exception dispatcher. Must be public because it's referenced from AsmFuncs.s.\r | |
212 | \r | |
213 | @param ExceptionType Exception Type\r | |
214 | @param Context System Context\r | |
215 | **/\r | |
216 | VOID\r | |
217 | CommonHandler (\r | |
218 | IN EFI_EXCEPTION_TYPE ExceptionType,\r | |
219 | IN EFI_SYSTEM_CONTEXT Context\r | |
220 | );\r | |
221 | \r | |
222 | #endif\r |