]>
Commit | Line | Data |
---|---|---|
2ef2b01e A |
1 | /** @file\r |
2 | \r | |
d6ebcab7 | 3 | Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r |
591fb378 | 4 | Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>\r |
2ef2b01e | 5 | \r |
d6ebcab7 | 6 | This program and the accompanying materials\r |
2ef2b01e A |
7 | are licensed and made available under the terms and conditions of the BSD License\r |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef __CPU_DXE_ARM_EXCEPTION_H__\r | |
17 | #define __CPU_DXE_ARM_EXCEPTION_H__\r | |
18 | \r | |
19 | #include <Uefi.h>\r | |
20 | \r | |
21 | #include <Library/ArmLib.h>\r | |
22 | #include <Library/BaseMemoryLib.h>\r | |
2ef2b01e A |
23 | #include <Library/DebugLib.h>\r |
24 | #include <Library/PcdLib.h>\r | |
25 | #include <Library/UefiBootServicesTableLib.h>\r | |
f659880b A |
26 | #include <Library/DxeServicesTableLib.h>\r |
27 | #include <Library/CacheMaintenanceLib.h>\r | |
28 | #include <Library/PeCoffGetEntryPointLib.h>\r | |
29 | #include <Library/UefiLib.h>\r | |
30 | #include <Library/CpuLib.h>\r | |
6f72e28d | 31 | #include <Library/DefaultExceptionHandlerLib.h>\r |
eeb78924 | 32 | #include <Library/DebugLib.h>\r |
2ef2b01e | 33 | \r |
f659880b | 34 | #include <Guid/DebugImageInfoTable.h>\r |
2ef2b01e A |
35 | #include <Protocol/Cpu.h>\r |
36 | #include <Protocol/DebugSupport.h>\r | |
37 | #include <Protocol/DebugSupportPeriodicCallback.h>\r | |
f659880b A |
38 | #include <Protocol/VirtualUncachedPages.h>\r |
39 | #include <Protocol/LoadedImage.h>\r | |
40 | \r | |
41 | \r | |
42 | #define EFI_MEMORY_CACHETYPE_MASK (EFI_MEMORY_UC | \\r | |
43 | EFI_MEMORY_WC | \\r | |
44 | EFI_MEMORY_WT | \\r | |
45 | EFI_MEMORY_WB | \\r | |
46 | EFI_MEMORY_UCE \\r | |
47 | )\r | |
2ef2b01e A |
48 | \r |
49 | \r | |
50 | /**\r | |
51 | This function registers and enables the handler specified by InterruptHandler for a processor \r | |
52 | interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r | |
53 | handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r | |
54 | The installed handler is called once for each processor interrupt or exception.\r | |
55 | \r | |
56 | @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r | |
57 | are enabled and FALSE if interrupts are disabled.\r | |
58 | @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r | |
59 | when a processor interrupt occurs. If this parameter is NULL, then the handler\r | |
60 | will be uninstalled.\r | |
61 | \r | |
62 | @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.\r | |
63 | @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was\r | |
64 | previously installed.\r | |
65 | @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r | |
66 | previously installed.\r | |
67 | @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.\r | |
68 | \r | |
69 | **/\r | |
70 | EFI_STATUS\r | |
71 | RegisterInterruptHandler (\r | |
72 | IN EFI_EXCEPTION_TYPE InterruptType,\r | |
73 | IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r | |
74 | );\r | |
75 | \r | |
76 | \r | |
77 | /**\r | |
78 | This function registers and enables the handler specified by InterruptHandler for a processor \r | |
79 | interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r | |
80 | handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r | |
81 | The installed handler is called once for each processor interrupt or exception.\r | |
82 | \r | |
83 | @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r | |
84 | are enabled and FALSE if interrupts are disabled.\r | |
85 | @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r | |
86 | when a processor interrupt occurs. If this parameter is NULL, then the handler\r | |
87 | will be uninstalled.\r | |
88 | \r | |
89 | @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.\r | |
90 | @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was\r | |
91 | previously installed.\r | |
92 | @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r | |
93 | previously installed.\r | |
94 | @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.\r | |
95 | \r | |
96 | **/\r | |
97 | EFI_STATUS\r | |
98 | RegisterDebuggerInterruptHandler (\r | |
99 | IN EFI_EXCEPTION_TYPE InterruptType,\r | |
100 | IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r | |
101 | );\r | |
102 | \r | |
103 | \r | |
f659880b A |
104 | EFI_STATUS\r |
105 | EFIAPI\r | |
106 | CpuSetMemoryAttributes (\r | |
107 | IN EFI_CPU_ARCH_PROTOCOL *This,\r | |
108 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
109 | IN UINT64 Length,\r | |
110 | IN UINT64 Attributes\r | |
111 | );\r | |
112 | \r | |
2ef2b01e A |
113 | EFI_STATUS\r |
114 | InitializeExceptions (\r | |
2ac288f9 | 115 | IN EFI_CPU_ARCH_PROTOCOL *Cpu\r |
116 | );\r | |
2ef2b01e | 117 | \r |
f659880b A |
118 | EFI_STATUS\r |
119 | SyncCacheConfig (\r | |
120 | IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol\r | |
121 | );\r | |
122 | \r | |
123 | EFI_STATUS \r | |
124 | ConvertSectionToPages (\r | |
125 | IN EFI_PHYSICAL_ADDRESS BaseAddress\r | |
126 | );\r | |
127 | \r | |
44788bae | 128 | /**\r |
129 | * Publish ARM Processor Data table in UEFI SYSTEM Table.\r | |
130 | * @param HobStart Pointer to the beginning of the HOB List from PEI.\r | |
131 | *\r | |
132 | * Description : This function iterates through HOB list and finds ARM processor Table Entry HOB.\r | |
133 | * If the ARM processor Table Entry HOB is found, the HOB data is copied to run-time memory\r | |
134 | * and a pointer is assigned to it in ARM processor table. Then the ARM processor table is\r | |
135 | * installed in EFI configuration table.\r | |
136 | **/\r | |
137 | VOID\r | |
138 | EFIAPI\r | |
139 | PublishArmProcessorTable(\r | |
140 | VOID\r | |
141 | );\r | |
f659880b | 142 | \r |
591fb378 OM |
143 | EFI_STATUS\r |
144 | SetMemoryAttributes (\r | |
145 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
146 | IN UINT64 Length,\r | |
147 | IN UINT64 Attributes,\r | |
148 | IN EFI_PHYSICAL_ADDRESS VirtualMask\r | |
149 | );\r | |
150 | \r | |
2e969d2e OM |
151 | // The ARM Attributes might be defined on 64-bit (case of the long format description table)\r |
152 | UINT64\r | |
153 | EfiAttributeToArmAttribute (\r | |
154 | IN UINT64 EfiAttributes\r | |
155 | );\r | |
156 | \r | |
157 | EFI_STATUS\r | |
158 | GetMemoryRegion (\r | |
159 | IN OUT UINTN *BaseAddress,\r | |
160 | OUT UINTN *RegionLength,\r | |
161 | OUT UINTN *RegionAttributes\r | |
162 | );\r | |
163 | \r | |
25402f5d HL |
164 | VOID\r |
165 | GetRootTranslationTableInfo (\r | |
166 | IN UINTN T0SZ,\r | |
167 | OUT UINTN *TableLevel,\r | |
168 | OUT UINTN *TableEntryCount\r | |
169 | );\r | |
170 | \r | |
591fb378 OM |
171 | EFI_STATUS\r |
172 | SetGcdMemorySpaceAttributes (\r | |
25402f5d | 173 | IN EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap,\r |
591fb378 OM |
174 | IN UINTN NumberOfDescriptors,\r |
175 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
176 | IN UINT64 Length,\r | |
177 | IN UINT64 Attributes\r | |
178 | );\r | |
179 | \r | |
f659880b A |
180 | extern VIRTUAL_UNCACHED_PAGES_PROTOCOL gVirtualUncachedPages;\r |
181 | \r | |
2ef2b01e | 182 | #endif // __CPU_DXE_ARM_EXCEPTION_H__\r |