]>
Commit | Line | Data |
---|---|---|
9e604fe4 | 1 | /** @file\r |
c1f23d63 | 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 | |
9e604fe4 | 15 | #ifndef _PLDEBUG_SUPPORT_H_\r |
16 | #define _PLDEBUG_SUPPORT_H_\r | |
c1f23d63 | 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 | |
9e604fe4 | 39 | /**\r |
40 | IPF specific DebugSupport driver initialization. \r | |
c1f23d63 | 41 | \r |
9e604fe4 | 42 | Must be public because it's referenced from DebugSupport.c\r |
c1f23d63 | 43 | \r |
9e604fe4 | 44 | @retval EFI_SUCCESS Always.\r |
c1f23d63 | 45 | \r |
9e604fe4 | 46 | **/\r |
c1f23d63 | 47 | EFI_STATUS\r |
9e604fe4 | 48 | PlInitializeDebugSupportDriver (\r |
49 | VOID\r | |
50 | );\r | |
c1f23d63 | 51 | \r |
9e604fe4 | 52 | /**\r |
c1f23d63 | 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 | |
9e604fe4 | 56 | @param ImageHandle The firmware allocated handle for the EFI image.\r |
c1f23d63 | 57 | \r |
9e604fe4 | 58 | @retval EFI_SUCCESS Always.\r |
c1f23d63 | 59 | \r |
9e604fe4 | 60 | **/\r |
61 | EFI_STATUS\r | |
62 | EFIAPI\r | |
63 | PlUnloadDebugSupportDriver (\r | |
64 | IN EFI_HANDLE ImageHandle\r | |
65 | );\r | |
c1f23d63 | 66 | \r |
9e604fe4 | 67 | /**\r |
68 | C callable function to obtain the current value of IVA.\r | |
c1f23d63 | 69 | \r |
9e604fe4 | 70 | @return Current value of IVA.\r |
71 | \r | |
72 | **/\r | |
c1f23d63 | 73 | VOID *\r |
74 | GetIva (\r | |
75 | VOID\r | |
9e604fe4 | 76 | );\r |
c1f23d63 | 77 | \r |
9e604fe4 | 78 | /**\r |
79 | HookStub will be copied from it's loaded location into the IVT when\r | |
80 | an IVT entry is hooked.\r | |
c1f23d63 | 81 | \r |
9e604fe4 | 82 | **/\r |
c1f23d63 | 83 | VOID\r |
84 | HookStub (\r | |
85 | VOID\r | |
9e604fe4 | 86 | );\r |
c1f23d63 | 87 | \r |
9e604fe4 | 88 | /**\r |
89 | Chains an interrupt handler.\r | |
c1f23d63 | 90 | \r |
9e604fe4 | 91 | **/\r |
c1f23d63 | 92 | VOID\r |
93 | ChainHandler (\r | |
94 | VOID\r | |
9e604fe4 | 95 | );\r |
c1f23d63 | 96 | \r |
9e604fe4 | 97 | /**\r |
98 | Unchains an interrupt handler.\r | |
c1f23d63 | 99 | \r |
9e604fe4 | 100 | **/\r |
c1f23d63 | 101 | VOID\r |
102 | UnchainHandler (\r | |
103 | VOID\r | |
9e604fe4 | 104 | );\r |
c1f23d63 | 105 | \r |
9e604fe4 | 106 | /**\r |
107 | C callable function to enable/disable interrupts.\r | |
c1f23d63 | 108 | \r |
9e604fe4 | 109 | @param NewInterruptState New Interrupt State.\r |
c1f23d63 | 110 | \r |
9e604fe4 | 111 | @return Previous state of psr.ic.\r |
c1f23d63 | 112 | \r |
9e604fe4 | 113 | **/\r |
c1f23d63 | 114 | UINT64\r |
115 | ProgramInterruptFlags (\r | |
116 | IN UINT64 NewInterruptState\r | |
9e604fe4 | 117 | );\r |
c1f23d63 | 118 | \r |
9e604fe4 | 119 | /**\r |
120 | Flushes instruction cache for specified number of bytes.\r | |
c1f23d63 | 121 | \r |
9e604fe4 | 122 | @param StartAddress Cache Start Address.\r |
123 | @param SizeInBytes Cache Size.\r | |
c1f23d63 | 124 | \r |
9e604fe4 | 125 | **/\r |
c1f23d63 | 126 | VOID\r |
127 | InstructionCacheFlush (\r | |
128 | IN VOID *StartAddress,\r | |
129 | IN UINTN SizeInBytes\r | |
9e604fe4 | 130 | );\r |
c1f23d63 | 131 | \r |
9e604fe4 | 132 | /**\r |
133 | This is a DebugSupport protocol member function, hard\r | |
134 | coded to support only 1 processor for now.\r | |
c1f23d63 | 135 | \r |
9e604fe4 | 136 | @param This The DebugSupport instance\r |
137 | @param MaxProcessorIndex The maximuim supported processor index\r | |
c1f23d63 | 138 | \r |
9e604fe4 | 139 | @retval EFI_SUCCESS Always returned with **MaxProcessorIndex set to 0.\r |
c1f23d63 | 140 | \r |
9e604fe4 | 141 | **/\r |
c1f23d63 | 142 | EFI_STATUS\r |
143 | EFIAPI\r | |
144 | GetMaximumProcessorIndex (\r | |
145 | IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r | |
146 | OUT UINTN *MaxProcessorIndex\r | |
9e604fe4 | 147 | );\r |
c1f23d63 | 148 | \r |
9e604fe4 | 149 | /**\r |
150 | DebugSupport protocol member function.\r | |
c1f23d63 | 151 | \r |
9e604fe4 | 152 | @param This The DebugSupport instance\r |
153 | @param ProcessorIndex Which processor the callback applies to.\r | |
154 | @param PeriodicCallback Callback function\r | |
c1f23d63 | 155 | \r |
9e604fe4 | 156 | @retval EFI_SUCCESS Indicates the callback was registered.\r |
157 | @retval others Callback was not registered.\r | |
c1f23d63 | 158 | \r |
9e604fe4 | 159 | **/\r |
c1f23d63 | 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 | |
9e604fe4 | 166 | );\r |
c1f23d63 | 167 | \r |
9e604fe4 | 168 | /**\r |
169 | DebugSupport protocol member function.\r | |
c1f23d63 | 170 | \r |
9e604fe4 | 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 | |
c1f23d63 | 175 | \r |
9e604fe4 | 176 | @retval EFI_SUCCESS Indicates the callback was registered.\r |
177 | @retval others Callback was not registered.\r | |
c1f23d63 | 178 | \r |
9e604fe4 | 179 | **/\r |
c1f23d63 | 180 | EFI_STATUS\r |
181 | EFIAPI\r | |
182 | RegisterExceptionCallback (\r | |
183 | IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r | |
184 | IN UINTN ProcessorIndex,\r | |
9e604fe4 | 185 | IN EFI_EXCEPTION_CALLBACK NewCallback,\r |
c1f23d63 | 186 | IN EFI_EXCEPTION_TYPE ExceptionType\r |
9e604fe4 | 187 | );\r |
c1f23d63 | 188 | \r |
9e604fe4 | 189 | /**\r |
190 | DebugSupport protocol member function. Calls assembly routine to flush cache.\r | |
c1f23d63 | 191 | \r |
9e604fe4 | 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 | |
c1f23d63 | 196 | \r |
9e604fe4 | 197 | @retval EFI_SUCCESS Always returned.\r |
c1f23d63 | 198 | \r |
9e604fe4 | 199 | **/\r |
c1f23d63 | 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 | |
9e604fe4 | 207 | );\r |
c1f23d63 | 208 | \r |
9e604fe4 | 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 | |
c1f23d63 | 212 | \r |
9e604fe4 | 213 | @param ExceptionType Exception Type\r |
214 | @param Context System Context\r | |
215 | **/\r | |
c1f23d63 | 216 | VOID\r |
217 | CommonHandler (\r | |
218 | IN EFI_EXCEPTION_TYPE ExceptionType,\r | |
219 | IN EFI_SYSTEM_CONTEXT Context\r | |
9e604fe4 | 220 | );\r |
c1f23d63 | 221 | \r |
222 | #endif\r |