]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | \r | |
3 | Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r | |
4 | Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>\r | |
5 | \r | |
6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
7 | \r | |
8 | **/\r | |
9 | \r | |
10 | #ifndef __CPU_DXE_ARM_EXCEPTION_H__\r | |
11 | #define __CPU_DXE_ARM_EXCEPTION_H__\r | |
12 | \r | |
13 | #include <Uefi.h>\r | |
14 | \r | |
15 | #include <Library/ArmLib.h>\r | |
16 | #include <Library/ArmMmuLib.h>\r | |
17 | #include <Library/BaseMemoryLib.h>\r | |
18 | #include <Library/DebugLib.h>\r | |
19 | #include <Library/PcdLib.h>\r | |
20 | #include <Library/UefiBootServicesTableLib.h>\r | |
21 | #include <Library/DxeServicesTableLib.h>\r | |
22 | #include <Library/CacheMaintenanceLib.h>\r | |
23 | #include <Library/PeCoffGetEntryPointLib.h>\r | |
24 | #include <Library/UefiLib.h>\r | |
25 | #include <Library/CpuLib.h>\r | |
26 | #include <Library/DefaultExceptionHandlerLib.h>\r | |
27 | #include <Library/DebugLib.h>\r | |
28 | \r | |
29 | #include <Guid/DebugImageInfoTable.h>\r | |
30 | #include <Protocol/Cpu.h>\r | |
31 | #include <Protocol/DebugSupport.h>\r | |
32 | #include <Protocol/LoadedImage.h>\r | |
33 | \r | |
34 | extern BOOLEAN mIsFlushingGCD;\r | |
35 | \r | |
36 | /**\r | |
37 | This function registers and enables the handler specified by InterruptHandler for a processor\r | |
38 | interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the\r | |
39 | handler for the processor interrupt or exception type specified by InterruptType is uninstalled.\r | |
40 | The installed handler is called once for each processor interrupt or exception.\r | |
41 | \r | |
42 | @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r | |
43 | are enabled and FALSE if interrupts are disabled.\r | |
44 | @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r | |
45 | when a processor interrupt occurs. If this parameter is NULL, then the handler\r | |
46 | will be uninstalled.\r | |
47 | \r | |
48 | @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.\r | |
49 | @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was\r | |
50 | previously installed.\r | |
51 | @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r | |
52 | previously installed.\r | |
53 | @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.\r | |
54 | \r | |
55 | **/\r | |
56 | EFI_STATUS\r | |
57 | RegisterInterruptHandler (\r | |
58 | IN EFI_EXCEPTION_TYPE InterruptType,\r | |
59 | IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r | |
60 | );\r | |
61 | \r | |
62 | \r | |
63 | /**\r | |
64 | This function registers and enables the handler specified by InterruptHandler for a processor\r | |
65 | interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the\r | |
66 | handler for the processor interrupt or exception type specified by InterruptType is uninstalled.\r | |
67 | The installed handler is called once for each processor interrupt or exception.\r | |
68 | \r | |
69 | @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r | |
70 | are enabled and FALSE if interrupts are disabled.\r | |
71 | @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r | |
72 | when a processor interrupt occurs. If this parameter is NULL, then the handler\r | |
73 | will be uninstalled.\r | |
74 | \r | |
75 | @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.\r | |
76 | @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was\r | |
77 | previously installed.\r | |
78 | @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r | |
79 | previously installed.\r | |
80 | @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.\r | |
81 | \r | |
82 | **/\r | |
83 | EFI_STATUS\r | |
84 | RegisterDebuggerInterruptHandler (\r | |
85 | IN EFI_EXCEPTION_TYPE InterruptType,\r | |
86 | IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r | |
87 | );\r | |
88 | \r | |
89 | \r | |
90 | EFI_STATUS\r | |
91 | EFIAPI\r | |
92 | CpuSetMemoryAttributes (\r | |
93 | IN EFI_CPU_ARCH_PROTOCOL *This,\r | |
94 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
95 | IN UINT64 Length,\r | |
96 | IN UINT64 Attributes\r | |
97 | );\r | |
98 | \r | |
99 | EFI_STATUS\r | |
100 | InitializeExceptions (\r | |
101 | IN EFI_CPU_ARCH_PROTOCOL *Cpu\r | |
102 | );\r | |
103 | \r | |
104 | EFI_STATUS\r | |
105 | SyncCacheConfig (\r | |
106 | IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol\r | |
107 | );\r | |
108 | \r | |
109 | /**\r | |
110 | * Publish ARM Processor Data table in UEFI SYSTEM Table.\r | |
111 | * @param HobStart Pointer to the beginning of the HOB List from PEI.\r | |
112 | *\r | |
113 | * Description : This function iterates through HOB list and finds ARM processor Table Entry HOB.\r | |
114 | * If the ARM processor Table Entry HOB is found, the HOB data is copied to run-time memory\r | |
115 | * and a pointer is assigned to it in ARM processor table. Then the ARM processor table is\r | |
116 | * installed in EFI configuration table.\r | |
117 | **/\r | |
118 | VOID\r | |
119 | EFIAPI\r | |
120 | PublishArmProcessorTable(\r | |
121 | VOID\r | |
122 | );\r | |
123 | \r | |
124 | // The ARM Attributes might be defined on 64-bit (case of the long format description table)\r | |
125 | UINT64\r | |
126 | EfiAttributeToArmAttribute (\r | |
127 | IN UINT64 EfiAttributes\r | |
128 | );\r | |
129 | \r | |
130 | EFI_STATUS\r | |
131 | GetMemoryRegion (\r | |
132 | IN OUT UINTN *BaseAddress,\r | |
133 | OUT UINTN *RegionLength,\r | |
134 | OUT UINTN *RegionAttributes\r | |
135 | );\r | |
136 | \r | |
137 | EFI_STATUS\r | |
138 | SetGcdMemorySpaceAttributes (\r | |
139 | IN EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap,\r | |
140 | IN UINTN NumberOfDescriptors,\r | |
141 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
142 | IN UINT64 Length,\r | |
143 | IN UINT64 Attributes\r | |
144 | );\r | |
145 | \r | |
146 | #endif // __CPU_DXE_ARM_EXCEPTION_H__\r |