3 Copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
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 __CPU_DXE_ARM_EXCEPTION_H__
16 #define __CPU_DXE_ARM_EXCEPTION_H__
20 #include <Library/ArmLib.h>
21 #include <Library/BaseMemoryLib.h>
22 #include <Library/DebugLib.h>
23 #include <Library/PcdLib.h>
24 #include <Library/UefiBootServicesTableLib.h>
25 #include <Library/DxeServicesTableLib.h>
26 #include <Library/CacheMaintenanceLib.h>
27 #include <Library/PeCoffGetEntryPointLib.h>
28 #include <Library/UefiLib.h>
29 #include <Library/CpuLib.h>
31 #include <Guid/DebugImageInfoTable.h>
32 #include <Protocol/Cpu.h>
33 #include <Protocol/DebugSupport.h>
34 #include <Protocol/DebugSupportPeriodicCallback.h>
35 #include <Protocol/VirtualUncachedPages.h>
36 #include <Protocol/LoadedImage.h>
39 #define EFI_MEMORY_CACHETYPE_MASK (EFI_MEMORY_UC | \
48 This function registers and enables the handler specified by InterruptHandler for a processor
49 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
50 handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
51 The installed handler is called once for each processor interrupt or exception.
53 @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts
54 are enabled and FALSE if interrupts are disabled.
55 @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
56 when a processor interrupt occurs. If this parameter is NULL, then the handler
59 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
60 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was
62 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not
64 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.
68 RegisterInterruptHandler (
69 IN EFI_EXCEPTION_TYPE InterruptType
,
70 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
75 This function registers and enables the handler specified by InterruptHandler for a processor
76 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
77 handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
78 The installed handler is called once for each processor interrupt or exception.
80 @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts
81 are enabled and FALSE if interrupts are disabled.
82 @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
83 when a processor interrupt occurs. If this parameter is NULL, then the handler
86 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
87 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was
89 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not
91 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.
95 RegisterDebuggerInterruptHandler (
96 IN EFI_EXCEPTION_TYPE InterruptType
,
97 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
103 CpuSetMemoryAttributes (
104 IN EFI_CPU_ARCH_PROTOCOL
*This
,
105 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
111 InitializeExceptions (
112 IN EFI_CPU_ARCH_PROTOCOL
*Cpu
117 IN EFI_CPU_ARCH_PROTOCOL
*CpuProtocol
121 ConvertSectionToPages (
122 IN EFI_PHYSICAL_ADDRESS BaseAddress
126 extern VIRTUAL_UNCACHED_PAGES_PROTOCOL gVirtualUncachedPages
;
128 #endif // __CPU_DXE_ARM_EXCEPTION_H__