]>
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 |
4059386c | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
2ef2b01e A |
7 | \r |
8 | **/\r | |
9 | \r | |
cc15a619 PG |
10 | #ifndef CPU_DXE_H_\r |
11 | #define CPU_DXE_H_\r | |
2ef2b01e A |
12 | \r |
13 | #include <Uefi.h>\r | |
14 | \r | |
15 | #include <Library/ArmLib.h>\r | |
521f3ced | 16 | #include <Library/ArmMmuLib.h>\r |
2ef2b01e | 17 | #include <Library/BaseMemoryLib.h>\r |
2ef2b01e A |
18 | #include <Library/DebugLib.h>\r |
19 | #include <Library/PcdLib.h>\r | |
20 | #include <Library/UefiBootServicesTableLib.h>\r | |
f659880b A |
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 | |
6f72e28d | 26 | #include <Library/DefaultExceptionHandlerLib.h>\r |
eeb78924 | 27 | #include <Library/DebugLib.h>\r |
2ef2b01e | 28 | \r |
f659880b | 29 | #include <Guid/DebugImageInfoTable.h>\r |
2ef2b01e A |
30 | #include <Protocol/Cpu.h>\r |
31 | #include <Protocol/DebugSupport.h>\r | |
f659880b A |
32 | #include <Protocol/LoadedImage.h>\r |
33 | \r | |
3b44bb55 | 34 | extern BOOLEAN mIsFlushingGCD;\r |
f659880b | 35 | \r |
2ef2b01e | 36 | /**\r |
3402aac7 RC |
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 | |
2ef2b01e A |
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 | |
3402aac7 RC |
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 | |
2ef2b01e A |
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 | |
f659880b A |
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 | |
2ef2b01e A |
99 | EFI_STATUS\r |
100 | InitializeExceptions (\r | |
2ac288f9 | 101 | IN EFI_CPU_ARCH_PROTOCOL *Cpu\r |
102 | );\r | |
2ef2b01e | 103 | \r |
f659880b A |
104 | EFI_STATUS\r |
105 | SyncCacheConfig (\r | |
106 | IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol\r | |
107 | );\r | |
108 | \r | |
44788bae | 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 | |
f659880b | 123 | \r |
2e969d2e OM |
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 | |
591fb378 OM |
137 | EFI_STATUS\r |
138 | SetGcdMemorySpaceAttributes (\r | |
25402f5d | 139 | IN EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap,\r |
591fb378 OM |
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 | |
cc15a619 | 146 | #endif // CPU_DXE_H_\r |