]>
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 | |
429309e0 | 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 | |
429309e0 MK |
58 | IN EFI_EXCEPTION_TYPE InterruptType,\r |
59 | IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r | |
2ef2b01e A |
60 | );\r |
61 | \r | |
2ef2b01e | 62 | /**\r |
3402aac7 RC |
63 | This function registers and enables the handler specified by InterruptHandler for a processor\r |
64 | interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the\r | |
65 | handler for the processor interrupt or exception type specified by InterruptType is uninstalled.\r | |
2ef2b01e A |
66 | The installed handler is called once for each processor interrupt or exception.\r |
67 | \r | |
68 | @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r | |
69 | are enabled and FALSE if interrupts are disabled.\r | |
70 | @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r | |
71 | when a processor interrupt occurs. If this parameter is NULL, then the handler\r | |
72 | will be uninstalled.\r | |
73 | \r | |
74 | @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.\r | |
75 | @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was\r | |
76 | previously installed.\r | |
77 | @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r | |
78 | previously installed.\r | |
79 | @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.\r | |
80 | \r | |
81 | **/\r | |
82 | EFI_STATUS\r | |
83 | RegisterDebuggerInterruptHandler (\r | |
429309e0 MK |
84 | IN EFI_EXCEPTION_TYPE InterruptType,\r |
85 | IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r | |
2ef2b01e A |
86 | );\r |
87 | \r | |
f659880b A |
88 | EFI_STATUS\r |
89 | EFIAPI\r | |
90 | CpuSetMemoryAttributes (\r | |
429309e0 MK |
91 | IN EFI_CPU_ARCH_PROTOCOL *This,\r |
92 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
93 | IN UINT64 Length,\r | |
94 | IN UINT64 Attributes\r | |
f659880b A |
95 | );\r |
96 | \r | |
2ef2b01e A |
97 | EFI_STATUS\r |
98 | InitializeExceptions (\r | |
429309e0 | 99 | IN EFI_CPU_ARCH_PROTOCOL *Cpu\r |
2ac288f9 | 100 | );\r |
2ef2b01e | 101 | \r |
f659880b A |
102 | EFI_STATUS\r |
103 | SyncCacheConfig (\r | |
429309e0 | 104 | IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol\r |
f659880b A |
105 | );\r |
106 | \r | |
2e969d2e OM |
107 | // The ARM Attributes might be defined on 64-bit (case of the long format description table)\r |
108 | UINT64\r | |
109 | EfiAttributeToArmAttribute (\r | |
429309e0 | 110 | IN UINT64 EfiAttributes\r |
2e969d2e OM |
111 | );\r |
112 | \r | |
113 | EFI_STATUS\r | |
114 | GetMemoryRegion (\r | |
429309e0 MK |
115 | IN OUT UINTN *BaseAddress,\r |
116 | OUT UINTN *RegionLength,\r | |
117 | OUT UINTN *RegionAttributes\r | |
2e969d2e OM |
118 | );\r |
119 | \r | |
591fb378 OM |
120 | EFI_STATUS\r |
121 | SetGcdMemorySpaceAttributes (\r | |
429309e0 MK |
122 | IN EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap,\r |
123 | IN UINTN NumberOfDescriptors,\r | |
124 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
125 | IN UINT64 Length,\r | |
126 | IN UINT64 Attributes\r | |
591fb378 OM |
127 | );\r |
128 | \r | |
cc15a619 | 129 | #endif // CPU_DXE_H_\r |