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>
30 #define DISABLE_INTERRUPTS 0UL
33 // The remaining definitions comprise the protocol members.
35 #define EFI_ISA IsaIpf
38 IPF specific DebugSupport driver initialization.
40 Must be public because it's referenced from DebugSupport.c
42 @retval EFI_SUCCESS Always.
46 PlInitializeDebugSupportDriver (
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.
61 PlUnloadDebugSupportDriver (
62 IN EFI_HANDLE ImageHandle
66 C callable function to obtain the current value of IVA.
68 @return Current value of IVA.
77 HookStub will be copied from it's loaded location into the IVT when
78 an IVT entry is hooked.
87 Chains an interrupt handler.
96 Unchains an interrupt handler.
105 C callable function to enable/disable interrupts.
107 @param NewInterruptState New Interrupt State.
109 @return Previous state of psr.ic.
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.
125 InstructionCacheFlush (
126 IN VOID
*StartAddress
,
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.
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.
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.
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.
200 InvalidateInstructionCache (
201 IN EFI_DEBUG_SUPPORT_PROTOCOL
*This
,
202 IN UINTN ProcessorIndex
,
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
216 IN EFI_EXCEPTION_TYPE ExceptionType
,
217 IN EFI_SYSTEM_CONTEXT Context