]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Drivers/CpuDxe/CpuDxe.h
ArmPkg: Apply uncrustify changes
[mirror_edk2.git] / ArmPkg / Drivers / CpuDxe / CpuDxe.h
CommitLineData
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 34extern 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
56EFI_STATUS\r
57RegisterInterruptHandler (\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
82EFI_STATUS\r
83RegisterDebuggerInterruptHandler (\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
88EFI_STATUS\r
89EFIAPI\r
90CpuSetMemoryAttributes (\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
97EFI_STATUS\r
98InitializeExceptions (\r
429309e0 99 IN EFI_CPU_ARCH_PROTOCOL *Cpu\r
2ac288f9 100 );\r
2ef2b01e 101\r
f659880b
A
102EFI_STATUS\r
103SyncCacheConfig (\r
429309e0 104 IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol\r
f659880b
A
105 );\r
106\r
44788bae 107/**\r
108 * Publish ARM Processor Data table in UEFI SYSTEM Table.\r
109 * @param HobStart Pointer to the beginning of the HOB List from PEI.\r
110 *\r
111 * Description : This function iterates through HOB list and finds ARM processor Table Entry HOB.\r
112 * If the ARM processor Table Entry HOB is found, the HOB data is copied to run-time memory\r
113 * and a pointer is assigned to it in ARM processor table. Then the ARM processor table is\r
114 * installed in EFI configuration table.\r
115**/\r
116VOID\r
117EFIAPI\r
429309e0 118PublishArmProcessorTable (\r
44788bae 119 VOID\r
120 );\r
f659880b 121\r
2e969d2e
OM
122// The ARM Attributes might be defined on 64-bit (case of the long format description table)\r
123UINT64\r
124EfiAttributeToArmAttribute (\r
429309e0 125 IN UINT64 EfiAttributes\r
2e969d2e
OM
126 );\r
127\r
128EFI_STATUS\r
129GetMemoryRegion (\r
429309e0
MK
130 IN OUT UINTN *BaseAddress,\r
131 OUT UINTN *RegionLength,\r
132 OUT UINTN *RegionAttributes\r
2e969d2e
OM
133 );\r
134\r
591fb378
OM
135EFI_STATUS\r
136SetGcdMemorySpaceAttributes (\r
429309e0
MK
137 IN EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap,\r
138 IN UINTN NumberOfDescriptors,\r
139 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
140 IN UINT64 Length,\r
141 IN UINT64 Attributes\r
591fb378
OM
142 );\r
143\r
cc15a619 144#endif // CPU_DXE_H_\r