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
19 // The package level header files this module uses
23 // The protocols, PPI and GUID defintions for this module
25 #include <Protocol/DebugSupport.h>
26 #include <Protocol/LoadedImage.h>
28 // The Library classes this module consumes
30 #include <Library/DebugLib.h>
31 #include <Library/UefiDriverEntryPoint.h>
32 #include <Library/BaseMemoryLib.h>
33 #include <Library/MemoryAllocationLib.h>
34 #include <Library/UefiBootServicesTableLib.h>
35 #include <Library/BaseLib.h>
36 #include <Library/PcdLib.h>
38 #define DISABLE_INTERRUPTS 0UL
41 // The remaining definitions comprise the protocol members.
43 #define EFI_ISA IsaIpf
46 // processor specific functions that must be public
49 plInitializeDebugSupportDriver (
55 IPF specific DebugSupport driver initialization. Must be public because it's
56 referenced from DebugSupport.c
69 plUnloadDebugSupportDriver (
70 IN EFI_HANDLE ImageHandle
75 Unload handler that is called during UnloadImage() - deallocates pool memory
76 used by the driver. Must be public because it's referenced from DebugSuport.c
79 ImageHandle - Image handle
83 EFI_STATUS - anything other than EFI_SUCCESS indicates the callback was not registered.
89 // Assembly worker functions and data referenced from plDebugSupport.c
99 C callable function to obtain the current value of IVA
120 HookStub will be copied from it's loaded location into the IVT when
121 an IVT entry is hooked.
142 Chains an interrupt handler
163 Unchains an interrupt handler
177 ProgramInterruptFlags (
178 IN UINT64 NewInterruptState
184 C callable function to enable/disable interrupts
188 NewInterruptState - New Interrupt State
192 Previous state of psr.ic
198 InstructionCacheFlush (
199 IN VOID
*StartAddress
,
206 Flushes instruction cache for specified number of bytes
210 StartAddress - Cache Start Address
211 SizeInBytes - Cache Size
222 GetMaximumProcessorIndex (
223 IN EFI_DEBUG_SUPPORT_PROTOCOL
*This
,
224 OUT UINTN
*MaxProcessorIndex
228 Routine Description: This is a DebugSupport protocol member function. Hard
229 coded to support only 1 processor for now.
232 This - The DebugSupport instance
233 MaxProcessorIndex - The maximuim supported processor index
236 Always returns EFI_SUCCESS with *MaxProcessorIndex set to 0
243 RegisterPeriodicCallback (
244 IN EFI_DEBUG_SUPPORT_PROTOCOL
*This
,
245 IN UINTN ProcessorIndex
,
246 IN EFI_PERIODIC_CALLBACK PeriodicCallback
251 DebugSupport protocol member function
254 This - The DebugSupport instance
255 ProcessorIndex - Which processor the callback applies to.
256 PeriodicCallback - Callback function
260 EFI_STATUS - anything other than EFI_SUCCESS indicates the callback was not registered.
267 RegisterExceptionCallback (
268 IN EFI_DEBUG_SUPPORT_PROTOCOL
*This
,
269 IN UINTN ProcessorIndex
,
270 IN EFI_EXCEPTION_CALLBACK NewHandler
,
271 IN EFI_EXCEPTION_TYPE ExceptionType
276 DebugSupport protocol member function
279 This - The DebugSupport instance
280 ProcessorIndex - Which processor the callback applies to.
281 NewCallback - Callback function
282 ExceptionType - Which exception to hook
286 EFI_STATUS - anything other than EFI_SUCCESS indicates the callback was not registered.
293 InvalidateInstructionCache (
294 IN EFI_DEBUG_SUPPORT_PROTOCOL
*This
,
295 IN UINTN ProcessorIndex
,
302 DebugSupport protocol member function. Calls assembly routine to flush cache.
305 This - The DebugSupport instance
306 ProcessorIndex - Which processor the callback applies to.
307 Start - Physical base of the memory range to be invalidated
308 Length - mininum number of bytes in instruction cache to invalidate
318 IN EFI_EXCEPTION_TYPE ExceptionType
,
319 IN EFI_SYSTEM_CONTEXT Context
324 C routine that is called for all registered exceptions. This is the main
325 exception dispatcher. Must be public because it's referenced from AsmFuncs.s.
328 ExceptionType - Exception Type
329 Context - System Context