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>
30 #include <Library/DefaultExceptionHandlerLib.h>
32 #include <Guid/DebugImageInfoTable.h>
33 #include <Protocol/Cpu.h>
34 #include <Protocol/DebugSupport.h>
35 #include <Protocol/DebugSupportPeriodicCallback.h>
36 #include <Protocol/VirtualUncachedPages.h>
37 #include <Protocol/LoadedImage.h>
40 #define EFI_MEMORY_CACHETYPE_MASK (EFI_MEMORY_UC | \
49 This function registers and enables the handler specified by InterruptHandler for a processor
50 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
51 handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
52 The installed handler is called once for each processor interrupt or exception.
54 @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts
55 are enabled and FALSE if interrupts are disabled.
56 @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
57 when a processor interrupt occurs. If this parameter is NULL, then the handler
60 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
61 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was
63 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not
65 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.
69 RegisterInterruptHandler (
70 IN EFI_EXCEPTION_TYPE InterruptType
,
71 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
76 This function registers and enables the handler specified by InterruptHandler for a processor
77 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
78 handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
79 The installed handler is called once for each processor interrupt or exception.
81 @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts
82 are enabled and FALSE if interrupts are disabled.
83 @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
84 when a processor interrupt occurs. If this parameter is NULL, then the handler
87 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
88 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was
90 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not
92 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.
96 RegisterDebuggerInterruptHandler (
97 IN EFI_EXCEPTION_TYPE InterruptType
,
98 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
104 CpuSetMemoryAttributes (
105 IN EFI_CPU_ARCH_PROTOCOL
*This
,
106 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
112 InitializeExceptions (
113 IN EFI_CPU_ARCH_PROTOCOL
*Cpu
118 IN EFI_CPU_ARCH_PROTOCOL
*CpuProtocol
122 ConvertSectionToPages (
123 IN EFI_PHYSICAL_ADDRESS BaseAddress
127 extern VIRTUAL_UNCACHED_PAGES_PROTOCOL gVirtualUncachedPages
;
129 #endif // __CPU_DXE_ARM_EXCEPTION_H__