1. Merger generic functions into one file.
[edk2.git] / MdeModulePkg / Universal / DebugSupportDxe / Ipf / PlDebugSupport.h
blobf8f5532de7c663272172043133e4691b5b0377fa
1 /** @file
2 IPF specific debugsupport types, macros, and definitions.
4 Copyright (c) 2004 - 2006 Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 **/
15 #ifndef _PLDEBUG_SUPPORT_H_
16 #define _PLDEBUG_SUPPORT_H_
19 #include <Uefi.h>
21 #include <Protocol/DebugSupport.h>
22 #include <Protocol/LoadedImage.h>
24 #include <Library/DebugLib.h>
25 #include <Library/UefiDriverEntryPoint.h>
26 #include <Library/BaseMemoryLib.h>
27 #include <Library/MemoryAllocationLib.h>
28 #include <Library/UefiBootServicesTableLib.h>
30 #define DISABLE_INTERRUPTS 0UL
33 // The remaining definitions comprise the protocol members.
35 #define EFI_ISA IsaIpf
37 /**
38 IPF specific DebugSupport driver initialization.
40 Must be public because it's referenced from DebugSupport.c
42 @retval EFI_SUCCESS Always.
44 **/
45 EFI_STATUS
46 PlInitializeDebugSupportDriver (
47 VOID
50 /**
51 Unload handler that is called during UnloadImage() - deallocates pool memory
52 used by the driver. Must be public because it's referenced from DebugSuport.c
54 @param ImageHandle The firmware allocated handle for the EFI image.
56 @retval EFI_SUCCESS Always.
58 **/
59 EFI_STATUS
60 EFIAPI
61 PlUnloadDebugSupportDriver (
62 IN EFI_HANDLE ImageHandle
65 /**
66 C callable function to obtain the current value of IVA.
68 @return Current value of IVA.
70 **/
71 VOID *
72 GetIva (
73 VOID
76 /**
77 HookStub will be copied from it's loaded location into the IVT when
78 an IVT entry is hooked.
80 **/
81 VOID
82 HookStub (
83 VOID
86 /**
87 Chains an interrupt handler.
89 **/
90 VOID
91 ChainHandler (
92 VOID
95 /**
96 Unchains an interrupt handler.
98 **/
99 VOID
100 UnchainHandler (
101 VOID
105 C callable function to enable/disable interrupts.
107 @param NewInterruptState New Interrupt State.
109 @return Previous state of psr.ic.
112 UINT64
113 ProgramInterruptFlags (
114 IN UINT64 NewInterruptState
118 Flushes instruction cache for specified number of bytes.
120 @param StartAddress Cache Start Address.
121 @param SizeInBytes Cache Size.
124 VOID
125 InstructionCacheFlush (
126 IN VOID *StartAddress,
127 IN UINTN SizeInBytes
131 This is a DebugSupport protocol member function, hard
132 coded to support only 1 processor for now.
134 @param This The DebugSupport instance
135 @param MaxProcessorIndex The maximuim supported processor index
137 @retval EFI_SUCCESS Always returned with **MaxProcessorIndex set to 0.
140 EFI_STATUS
141 EFIAPI
142 GetMaximumProcessorIndex (
143 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
144 OUT UINTN *MaxProcessorIndex
148 DebugSupport protocol member function.
150 @param This The DebugSupport instance
151 @param ProcessorIndex Which processor the callback applies to.
152 @param PeriodicCallback Callback function
154 @retval EFI_SUCCESS Indicates the callback was registered.
155 @retval others Callback was not registered.
158 EFI_STATUS
159 EFIAPI
160 RegisterPeriodicCallback (
161 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
162 IN UINTN ProcessorIndex,
163 IN EFI_PERIODIC_CALLBACK PeriodicCallback
167 DebugSupport protocol member function.
169 @param This The DebugSupport instance
170 @param ProcessorIndex Which processor the callback applies to.
171 @param NewCallback Callback function
172 @param ExceptionType Which exception to hook
174 @retval EFI_SUCCESS Indicates the callback was registered.
175 @retval others Callback was not registered.
178 EFI_STATUS
179 EFIAPI
180 RegisterExceptionCallback (
181 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
182 IN UINTN ProcessorIndex,
183 IN EFI_EXCEPTION_CALLBACK NewCallback,
184 IN EFI_EXCEPTION_TYPE ExceptionType
188 DebugSupport protocol member function. Calls assembly routine to flush cache.
190 @param This The DebugSupport instance
191 @param ProcessorIndex Which processor the callback applies to.
192 @param Start Physical base of the memory range to be invalidated
193 @param Length mininum number of bytes in instruction cache to invalidate
195 @retval EFI_SUCCESS Always returned.
198 EFI_STATUS
199 EFIAPI
200 InvalidateInstructionCache (
201 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
202 IN UINTN ProcessorIndex,
203 IN VOID *Start,
204 IN UINTN Length
208 C routine that is called for all registered exceptions. This is the main
209 exception dispatcher. Must be public because it's referenced from AsmFuncs.s.
211 @param ExceptionType Exception Type
212 @param Context System Context
214 VOID
215 CommonHandler (
216 IN EFI_EXCEPTION_TYPE ExceptionType,
217 IN EFI_SYSTEM_CONTEXT Context
220 #endif