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