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 // processor specific functions that must be public
43 plInitializeDebugSupportDriver (
49 IPF specific DebugSupport driver initialization. Must be public because it's
50 referenced from DebugSupport.c
63 plUnloadDebugSupportDriver (
64 IN EFI_HANDLE ImageHandle
69 Unload handler that is called during UnloadImage() - deallocates pool memory
70 used by the driver. Must be public because it's referenced from DebugSuport.c
73 ImageHandle - Image handle
77 EFI_STATUS - anything other than EFI_SUCCESS indicates the callback was not registered.
83 // Assembly worker functions and data referenced from plDebugSupport.c
93 C callable function to obtain the current value of IVA
114 HookStub will be copied from it's loaded location into the IVT when
115 an IVT entry is hooked.
136 Chains an interrupt handler
157 Unchains an interrupt handler
171 ProgramInterruptFlags (
172 IN UINT64 NewInterruptState
178 C callable function to enable/disable interrupts
182 NewInterruptState - New Interrupt State
186 Previous state of psr.ic
192 InstructionCacheFlush (
193 IN VOID
*StartAddress
,
200 Flushes instruction cache for specified number of bytes
204 StartAddress - Cache Start Address
205 SizeInBytes - Cache Size
216 GetMaximumProcessorIndex (
217 IN EFI_DEBUG_SUPPORT_PROTOCOL
*This
,
218 OUT UINTN
*MaxProcessorIndex
222 Routine Description: This is a DebugSupport protocol member function. Hard
223 coded to support only 1 processor for now.
226 This - The DebugSupport instance
227 MaxProcessorIndex - The maximuim supported processor index
230 Always returns EFI_SUCCESS with *MaxProcessorIndex set to 0
237 RegisterPeriodicCallback (
238 IN EFI_DEBUG_SUPPORT_PROTOCOL
*This
,
239 IN UINTN ProcessorIndex
,
240 IN EFI_PERIODIC_CALLBACK PeriodicCallback
245 DebugSupport protocol member function
248 This - The DebugSupport instance
249 ProcessorIndex - Which processor the callback applies to.
250 PeriodicCallback - Callback function
254 EFI_STATUS - anything other than EFI_SUCCESS indicates the callback was not registered.
261 RegisterExceptionCallback (
262 IN EFI_DEBUG_SUPPORT_PROTOCOL
*This
,
263 IN UINTN ProcessorIndex
,
264 IN EFI_EXCEPTION_CALLBACK NewHandler
,
265 IN EFI_EXCEPTION_TYPE ExceptionType
270 DebugSupport protocol member function
273 This - The DebugSupport instance
274 ProcessorIndex - Which processor the callback applies to.
275 NewCallback - Callback function
276 ExceptionType - Which exception to hook
280 EFI_STATUS - anything other than EFI_SUCCESS indicates the callback was not registered.
287 InvalidateInstructionCache (
288 IN EFI_DEBUG_SUPPORT_PROTOCOL
*This
,
289 IN UINTN ProcessorIndex
,
296 DebugSupport protocol member function. Calls assembly routine to flush cache.
299 This - The DebugSupport instance
300 ProcessorIndex - Which processor the callback applies to.
301 Start - Physical base of the memory range to be invalidated
302 Length - mininum number of bytes in instruction cache to invalidate
312 IN EFI_EXCEPTION_TYPE ExceptionType
,
313 IN EFI_SYSTEM_CONTEXT Context
318 C routine that is called for all registered exceptions. This is the main
319 exception dispatcher. Must be public because it's referenced from AsmFuncs.s.
322 ExceptionType - Exception Type
323 Context - System Context