]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.h
fixed one typo
[mirror_edk2.git] / MdeModulePkg / Universal / DebugSupportDxe / Ipf / PlDebugSupport.h
CommitLineData
9e604fe4 1/** @file\r
c1f23d63 2 IPF specific debugsupport types, macros, and definitions.\r
3 \r
4Copyright (c) 2004 - 2006 Intel Corporation \r
5All rights reserved. This program and the accompanying materials \r
6are licensed and made available under the terms and conditions of the BSD License \r
7which accompanies this distribution. The full text of the license may be found at \r
8http://opensource.org/licenses/bsd-license.php \r
9 \r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT 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
c1f23d63 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
9e604fe4 37/**\r
38 IPF specific DebugSupport driver initialization. \r
c1f23d63 39\r
9e604fe4 40 Must be public because it's referenced from DebugSupport.c\r
c1f23d63 41\r
9e604fe4 42 @retval EFI_SUCCESS Always.\r
c1f23d63 43\r
9e604fe4 44**/\r
c1f23d63 45EFI_STATUS\r
9e604fe4 46PlInitializeDebugSupportDriver (\r
47 VOID\r
48 );\r
c1f23d63 49\r
9e604fe4 50/**\r
c1f23d63 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
9e604fe4 54 @param ImageHandle The firmware allocated handle for the EFI image.\r
c1f23d63 55\r
9e604fe4 56 @retval EFI_SUCCESS Always.\r
c1f23d63 57\r
9e604fe4 58**/\r
59EFI_STATUS\r
60EFIAPI\r
61PlUnloadDebugSupportDriver (\r
62 IN EFI_HANDLE ImageHandle\r
63 );\r
c1f23d63 64\r
9e604fe4 65/**\r
66 C callable function to obtain the current value of IVA.\r
c1f23d63 67\r
9e604fe4 68 @return Current value of IVA.\r
69\r
70**/\r
c1f23d63 71VOID *\r
72GetIva (\r
73 VOID\r
9e604fe4 74 );\r
c1f23d63 75\r
9e604fe4 76/**\r
77 HookStub will be copied from it's loaded location into the IVT when\r
78 an IVT entry is hooked.\r
c1f23d63 79\r
9e604fe4 80**/\r
c1f23d63 81VOID\r
82HookStub (\r
83 VOID\r
9e604fe4 84 );\r
c1f23d63 85\r
9e604fe4 86/**\r
87 Chains an interrupt handler.\r
c1f23d63 88\r
9e604fe4 89**/\r
c1f23d63 90VOID\r
91ChainHandler (\r
92 VOID\r
9e604fe4 93 );\r
c1f23d63 94\r
9e604fe4 95/**\r
96 Unchains an interrupt handler.\r
c1f23d63 97\r
9e604fe4 98**/\r
c1f23d63 99VOID\r
100UnchainHandler (\r
101 VOID\r
9e604fe4 102 );\r
c1f23d63 103\r
9e604fe4 104/**\r
105 C callable function to enable/disable interrupts.\r
c1f23d63 106\r
9e604fe4 107 @param NewInterruptState New Interrupt State.\r
c1f23d63 108\r
9e604fe4 109 @return Previous state of psr.ic.\r
c1f23d63 110\r
9e604fe4 111**/\r
c1f23d63 112UINT64\r
113ProgramInterruptFlags (\r
114 IN UINT64 NewInterruptState\r
9e604fe4 115 );\r
c1f23d63 116\r
9e604fe4 117/**\r
118 Flushes instruction cache for specified number of bytes.\r
c1f23d63 119\r
9e604fe4 120 @param StartAddress Cache Start Address.\r
121 @param SizeInBytes Cache Size.\r
c1f23d63 122\r
9e604fe4 123**/\r
c1f23d63 124VOID\r
125InstructionCacheFlush (\r
126 IN VOID *StartAddress,\r
127 IN UINTN SizeInBytes\r
9e604fe4 128 );\r
c1f23d63 129\r
9e604fe4 130/**\r
131 This is a DebugSupport protocol member function, hard\r
132 coded to support only 1 processor for now.\r
c1f23d63 133\r
9e604fe4 134 @param This The DebugSupport instance\r
135 @param MaxProcessorIndex The maximuim supported processor index\r
c1f23d63 136\r
9e604fe4 137 @retval EFI_SUCCESS Always returned with **MaxProcessorIndex set to 0.\r
c1f23d63 138\r
9e604fe4 139**/\r
c1f23d63 140EFI_STATUS\r
141EFIAPI\r
142GetMaximumProcessorIndex (\r
143 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
144 OUT UINTN *MaxProcessorIndex\r
9e604fe4 145 );\r
c1f23d63 146\r
9e604fe4 147/**\r
148 DebugSupport protocol member function.\r
c1f23d63 149\r
9e604fe4 150 @param This The DebugSupport instance\r
151 @param ProcessorIndex Which processor the callback applies to.\r
152 @param PeriodicCallback Callback function\r
c1f23d63 153\r
9e604fe4 154 @retval EFI_SUCCESS Indicates the callback was registered.\r
155 @retval others Callback was not registered.\r
c1f23d63 156\r
9e604fe4 157**/\r
c1f23d63 158EFI_STATUS\r
159EFIAPI\r
160RegisterPeriodicCallback (\r
161 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
162 IN UINTN ProcessorIndex,\r
163 IN EFI_PERIODIC_CALLBACK PeriodicCallback\r
9e604fe4 164 );\r
c1f23d63 165\r
9e604fe4 166/**\r
167 DebugSupport protocol member function.\r
c1f23d63 168\r
9e604fe4 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
c1f23d63 173\r
9e604fe4 174 @retval EFI_SUCCESS Indicates the callback was registered.\r
175 @retval others Callback was not registered.\r
c1f23d63 176\r
9e604fe4 177**/\r
c1f23d63 178EFI_STATUS\r
179EFIAPI\r
180RegisterExceptionCallback (\r
181 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
182 IN UINTN ProcessorIndex,\r
9e604fe4 183 IN EFI_EXCEPTION_CALLBACK NewCallback,\r
c1f23d63 184 IN EFI_EXCEPTION_TYPE ExceptionType\r
9e604fe4 185 );\r
c1f23d63 186\r
9e604fe4 187/**\r
188 DebugSupport protocol member function. Calls assembly routine to flush cache.\r
c1f23d63 189\r
9e604fe4 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
c1f23d63 194\r
9e604fe4 195 @retval EFI_SUCCESS Always returned.\r
c1f23d63 196\r
9e604fe4 197**/\r
c1f23d63 198EFI_STATUS\r
199EFIAPI\r
200InvalidateInstructionCache (\r
201 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
202 IN UINTN ProcessorIndex,\r
203 IN VOID *Start,\r
204 IN UINTN Length\r
9e604fe4 205 );\r
c1f23d63 206\r
9e604fe4 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
c1f23d63 210\r
9e604fe4 211 @param ExceptionType Exception Type\r
212 @param Context System Context\r
213**/\r
c1f23d63 214VOID\r
215CommonHandler (\r
216 IN EFI_EXCEPTION_TYPE ExceptionType,\r
217 IN EFI_SYSTEM_CONTEXT Context\r
9e604fe4 218 );\r
c1f23d63 219\r
220#endif\r