TianoCore EDK2 master
Loading...
Searching...
No Matches
AcpiLib.h
Go to the documentation of this file.
1
11#ifndef __ACPI_LIB_H__
12#define __ACPI_LIB_H__
13
14#include <Uefi.h>
15
18
19//
20// Macros for the Generic Address Space
21//
22#define NULL_GAS { EFI_ACPI_5_0_SYSTEM_MEMORY, 0, 0, EFI_ACPI_5_0_UNDEFINED, 0L }
23#define ARM_GAS8(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 8, 0, EFI_ACPI_5_0_BYTE, Address }
24#define ARM_GAS16(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 16, 0, EFI_ACPI_5_0_WORD, Address }
25#define ARM_GAS32(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 32, 0, EFI_ACPI_5_0_DWORD, Address }
26#define ARM_GASN(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 0, 0, EFI_ACPI_5_0_DWORD, Address }
27
28//
29// Macros for the Multiple APIC Description Table (MADT)
30//
31#define EFI_ACPI_5_0_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase, GicDistVector) \
32 { \
33 EFI_ACPI_5_0_GICD, sizeof (EFI_ACPI_5_0_GIC_DISTRIBUTOR_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
34 GicDistHwId, GicDistBase, GicDistVector, EFI_ACPI_RESERVED_DWORD \
35 }
36
37#define EFI_ACPI_6_0_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase, GicDistVector, GicVersion) \
38 { \
39 EFI_ACPI_6_0_GICD, sizeof (EFI_ACPI_6_0_GIC_DISTRIBUTOR_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
40 GicDistHwId, GicDistBase, GicDistVector, GicVersion, \
41 {EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE} \
42 }
43
44// Note the parking protocol is configured by UEFI if required
45#define EFI_ACPI_5_0_GIC_STRUCTURE_INIT(GicId, AcpiCpuId, Flags, PmuIrq, GicBase) \
46 { \
47 EFI_ACPI_5_0_GIC, sizeof (EFI_ACPI_5_0_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
48 GicId, AcpiCpuId, Flags, 0, PmuIrq, 0, GicBase \
49 }
50
51// Note the parking protocol is configured by UEFI if required
52#define EFI_ACPI_5_1_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags, PmuIrq, \
53 GicBase, GicVBase, GicHBase, GsivId, GicRBase) \
54 { \
55 EFI_ACPI_5_1_GIC, sizeof (EFI_ACPI_5_1_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
56 GicId, AcpiCpuUid, Flags, 0, PmuIrq, 0, GicBase, GicVBase, GicHBase, \
57 GsivId, GicRBase, Mpidr \
58 }
59
60#define EFI_ACPI_6_0_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags, PmuIrq, \
61 GicBase, GicVBase, GicHBase, GsivId, GicRBase, Efficiency) \
62 { \
63 EFI_ACPI_6_0_GIC, sizeof (EFI_ACPI_6_0_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
64 GicId, AcpiCpuUid, Flags, 0, PmuIrq, 0, GicBase, GicVBase, GicHBase, \
65 GsivId, GicRBase, Mpidr, Efficiency, \
66 {EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE} \
67 }
68
69#define EFI_ACPI_6_3_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags, PmuIrq, \
70 GicBase, GicVBase, GicHBase, GsivId, GicRBase, Efficiency, SpeOvflIrq) \
71 { \
72 EFI_ACPI_6_0_GIC, sizeof (EFI_ACPI_6_3_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
73 GicId, AcpiCpuUid, Flags, 0, PmuIrq, 0, GicBase, GicVBase, GicHBase, \
74 GsivId, GicRBase, Mpidr, Efficiency, EFI_ACPI_RESERVED_BYTE, SpeOvflIrq \
75 }
76
77#define EFI_ACPI_6_0_GIC_MSI_FRAME_INIT(GicMsiFrameId, PhysicalBaseAddress, Flags, SPICount, SPIBase) \
78 { \
79 EFI_ACPI_6_0_GIC_MSI_FRAME, sizeof (EFI_ACPI_6_0_GIC_MSI_FRAME_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
80 GicMsiFrameId, PhysicalBaseAddress, Flags, SPICount, SPIBase \
81 }
82
83//
84// SBSA Generic Watchdog
85//
86#define EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(RefreshFramePhysicalAddress, \
87 ControlFramePhysicalAddress, WatchdogTimerGSIV, WatchdogTimerFlags) \
88 { \
89 EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG, sizeof(EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE), \
90 EFI_ACPI_RESERVED_BYTE, RefreshFramePhysicalAddress, ControlFramePhysicalAddress, \
91 WatchdogTimerGSIV, WatchdogTimerFlags \
92 }
93
94typedef
95BOOLEAN
96(EFIAPI *EFI_LOCATE_ACPI_CHECK)(
98 );
99
114 IN CONST EFI_GUID *AcpiFile,
115 IN EFI_LOCATE_ACPI_CHECK CheckAcpiTableFunction
116 );
117
130 IN CONST EFI_GUID *AcpiFile
131 );
132
145EFIAPI
147 IN OUT UINT8 *Buffer,
148 IN UINTN Size
149 );
150
169EFIAPI
171 IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol,
172 IN UINT32 TableSignature,
173 IN OUT UINTN *Index,
175 OUT UINTN *TableKey
176 );
177
194EFIAPI
196 IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol,
197 IN EFI_ACPI_HANDLE TableHandle,
198 IN CHAR8 *AsciiObjectPath,
199 IN UINTN Value
200 );
201
202#endif // __ACPI_LIB_H__
UINT64 UINTN
EFI_STATUS EFIAPI AcpiUpdateChecksum(IN OUT UINT8 *Buffer, IN UINTN Size)
Definition: AcpiLib.c:198
EFI_STATUS EFIAPI AcpiAmlObjectUpdateInteger(IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol, IN EFI_ACPI_HANDLE TableHandle, IN CHAR8 *AsciiObjectPath, IN UINTN Value)
Definition: AcpiLib.c:308
EFI_STATUS EFIAPI AcpiLocateTableBySignature(IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol, IN UINT32 TableSignature, IN OUT UINTN *Index, OUT EFI_ACPI_DESCRIPTION_HEADER **Table, OUT UINTN *TableKey)
Definition: AcpiLib.c:243
EFI_STATUS LocateAndInstallAcpiFromFvConditional(IN CONST EFI_GUID *AcpiFile, IN EFI_LOCATE_ACPI_CHECK CheckAcpiTableFunction)
Definition: AcpiLib.c:37
EFI_STATUS LocateAndInstallAcpiFromFv(IN CONST EFI_GUID *AcpiFile)
Definition: AcpiLib.c:178
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
Definition: Base.h:213