]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Drivers/CpuDxe/CpuDxe.h
Added a library for the default exception handler and started to add a dissasembler...
[mirror_edk2.git] / ArmPkg / Drivers / CpuDxe / CpuDxe.h
CommitLineData
2ef2b01e
A
1/** @file\r
2\r
3 Copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>\r
4\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef __CPU_DXE_ARM_EXCEPTION_H__\r
16#define __CPU_DXE_ARM_EXCEPTION_H__\r
17\r
18#include <Uefi.h>\r
19\r
20#include <Library/ArmLib.h>\r
21#include <Library/BaseMemoryLib.h>\r
2ef2b01e
A
22#include <Library/DebugLib.h>\r
23#include <Library/PcdLib.h>\r
24#include <Library/UefiBootServicesTableLib.h>\r
f659880b
A
25#include <Library/DxeServicesTableLib.h>\r
26#include <Library/CacheMaintenanceLib.h>\r
27#include <Library/PeCoffGetEntryPointLib.h>\r
28#include <Library/UefiLib.h>\r
29#include <Library/CpuLib.h>\r
6f72e28d 30#include <Library/DefaultExceptionHandlerLib.h>\r
2ef2b01e 31\r
f659880b 32#include <Guid/DebugImageInfoTable.h>\r
2ef2b01e
A
33#include <Protocol/Cpu.h>\r
34#include <Protocol/DebugSupport.h>\r
35#include <Protocol/DebugSupportPeriodicCallback.h>\r
f659880b
A
36#include <Protocol/VirtualUncachedPages.h>\r
37#include <Protocol/LoadedImage.h>\r
38\r
39\r
40#define EFI_MEMORY_CACHETYPE_MASK (EFI_MEMORY_UC | \\r
41 EFI_MEMORY_WC | \\r
42 EFI_MEMORY_WT | \\r
43 EFI_MEMORY_WB | \\r
44 EFI_MEMORY_UCE \\r
45 )\r
2ef2b01e
A
46\r
47\r
48/**\r
49 This function registers and enables the handler specified by InterruptHandler for a processor \r
50 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r
51 handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r
52 The installed handler is called once for each processor interrupt or exception.\r
53\r
54 @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r
55 are enabled and FALSE if interrupts are disabled.\r
56 @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r
57 when a processor interrupt occurs. If this parameter is NULL, then the handler\r
58 will be uninstalled.\r
59\r
60 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.\r
61 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was\r
62 previously installed.\r
63 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r
64 previously installed.\r
65 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.\r
66\r
67**/\r
68EFI_STATUS\r
69RegisterInterruptHandler (\r
70 IN EFI_EXCEPTION_TYPE InterruptType,\r
71 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r
72 );\r
73\r
74\r
75/**\r
76 This function registers and enables the handler specified by InterruptHandler for a processor \r
77 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r
78 handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r
79 The installed handler is called once for each processor interrupt or exception.\r
80\r
81 @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r
82 are enabled and FALSE if interrupts are disabled.\r
83 @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r
84 when a processor interrupt occurs. If this parameter is NULL, then the handler\r
85 will be uninstalled.\r
86\r
87 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.\r
88 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was\r
89 previously installed.\r
90 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r
91 previously installed.\r
92 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.\r
93\r
94**/\r
95EFI_STATUS\r
96RegisterDebuggerInterruptHandler (\r
97 IN EFI_EXCEPTION_TYPE InterruptType,\r
98 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r
99 );\r
100\r
101\r
f659880b
A
102EFI_STATUS\r
103EFIAPI\r
104CpuSetMemoryAttributes (\r
105 IN EFI_CPU_ARCH_PROTOCOL *This,\r
106 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
107 IN UINT64 Length,\r
108 IN UINT64 Attributes\r
109 );\r
110\r
2ef2b01e
A
111EFI_STATUS\r
112InitializeExceptions (\r
113 IN EFI_CPU_ARCH_PROTOCOL *Cpu\r
114 );\r
115\r
f659880b
A
116EFI_STATUS\r
117SyncCacheConfig (\r
118 IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol\r
119 );\r
120\r
121EFI_STATUS \r
122ConvertSectionToPages (\r
123 IN EFI_PHYSICAL_ADDRESS BaseAddress\r
124 );\r
125\r
126\r
127extern VIRTUAL_UNCACHED_PAGES_PROTOCOL gVirtualUncachedPages;\r
128\r
2ef2b01e 129#endif // __CPU_DXE_ARM_EXCEPTION_H__\r