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.
15 #ifndef _PLDEBUG_SUPPORT_H_
16 #define _PLDEBUG_SUPPORT_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>
29 #include <Library/BaseLib.h>
30 #include <Library/PcdLib.h>
32 #define DISABLE_INTERRUPTS 0UL
35 // The remaining definitions comprise the protocol members.
37 #define EFI_ISA IsaIpf
40 IPF specific DebugSupport driver initialization.
42 Must be public because it's referenced from DebugSupport.c
44 @retval EFI_SUCCESS Always.
48 PlInitializeDebugSupportDriver (
53 Unload handler that is called during UnloadImage() - deallocates pool memory
54 used by the driver. Must be public because it's referenced from DebugSuport.c
56 @param ImageHandle The firmware allocated handle for the EFI image.
58 @retval EFI_SUCCESS Always.
63 PlUnloadDebugSupportDriver (
64 IN EFI_HANDLE ImageHandle
68 C callable function to obtain the current value of IVA.
70 @return Current value of IVA.
79 HookStub will be copied from it's loaded location into the IVT when
80 an IVT entry is hooked.
89 Chains an interrupt handler.
98 Unchains an interrupt handler.
107 C callable function to enable/disable interrupts.
109 @param NewInterruptState New Interrupt State.
111 @return Previous state of psr.ic.
115 ProgramInterruptFlags (
116 IN UINT64 NewInterruptState
120 Flushes instruction cache for specified number of bytes.
122 @param StartAddress Cache Start Address.
123 @param SizeInBytes Cache Size.
127 InstructionCacheFlush (
128 IN VOID
*StartAddress
,
133 This is a DebugSupport protocol member function, hard
134 coded to support only 1 processor for now.
136 @param This The DebugSupport instance
137 @param MaxProcessorIndex The maximuim supported processor index
139 @retval EFI_SUCCESS Always returned with **MaxProcessorIndex set to 0.
144 GetMaximumProcessorIndex (
145 IN EFI_DEBUG_SUPPORT_PROTOCOL
*This
,
146 OUT UINTN
*MaxProcessorIndex
150 DebugSupport protocol member function.
152 @param This The DebugSupport instance
153 @param ProcessorIndex Which processor the callback applies to.
154 @param PeriodicCallback Callback function
156 @retval EFI_SUCCESS Indicates the callback was registered.
157 @retval others Callback was not registered.
162 RegisterPeriodicCallback (
163 IN EFI_DEBUG_SUPPORT_PROTOCOL
*This
,
164 IN UINTN ProcessorIndex
,
165 IN EFI_PERIODIC_CALLBACK PeriodicCallback
169 DebugSupport protocol member function.
171 @param This The DebugSupport instance
172 @param ProcessorIndex Which processor the callback applies to.
173 @param NewCallback Callback function
174 @param ExceptionType Which exception to hook
176 @retval EFI_SUCCESS Indicates the callback was registered.
177 @retval others Callback was not registered.
182 RegisterExceptionCallback (
183 IN EFI_DEBUG_SUPPORT_PROTOCOL
*This
,
184 IN UINTN ProcessorIndex
,
185 IN EFI_EXCEPTION_CALLBACK NewCallback
,
186 IN EFI_EXCEPTION_TYPE ExceptionType
190 DebugSupport protocol member function. Calls assembly routine to flush cache.
192 @param This The DebugSupport instance
193 @param ProcessorIndex Which processor the callback applies to.
194 @param Start Physical base of the memory range to be invalidated
195 @param Length mininum number of bytes in instruction cache to invalidate
197 @retval EFI_SUCCESS Always returned.
202 InvalidateInstructionCache (
203 IN EFI_DEBUG_SUPPORT_PROTOCOL
*This
,
204 IN UINTN ProcessorIndex
,
210 C routine that is called for all registered exceptions. This is the main
211 exception dispatcher. Must be public because it's referenced from AsmFuncs.s.
213 @param ExceptionType Exception Type
214 @param Context System Context
218 IN EFI_EXCEPTION_TYPE ExceptionType
,
219 IN EFI_SYSTEM_CONTEXT Context