TianoCore EDK2 master
Loading...
Searching...
No Matches
AcpiTable.h
Go to the documentation of this file.
1
9#ifndef _ACPI_TABLE_H_
10#define _ACPI_TABLE_H_
11
12#include <PiDxe.h>
13
14#include <Protocol/AcpiTable.h>
15#include <Guid/Acpi.h>
17
18#include <Library/BaseLib.h>
19#include <Library/DebugLib.h>
20#include <Library/UefiLib.h>
25#include <Library/PcdLib.h>
26#include <Library/HobLib.h>
28
29//
30// Statements that include other files
31//
33
34#include "AcpiSdt.h"
35
36//
37// Great than or equal to 2.0.
38//
39#define ACPI_TABLE_VERSION_GTE_2_0 (EFI_ACPI_TABLE_VERSION_2_0 |\
40 EFI_ACPI_TABLE_VERSION_3_0 | \
41 EFI_ACPI_TABLE_VERSION_4_0 | \
42 EFI_ACPI_TABLE_VERSION_5_0)
43
44//
45// Private Driver Data
46//
47//
48// ACPI Table Linked List Signature.
49//
50#define EFI_ACPI_TABLE_LIST_SIGNATURE SIGNATURE_32 ('E', 'A', 'T', 'L')
51
52//
53// ACPI Table Linked List Entry definition.
54//
55// Signature must be set to EFI_ACPI_TABLE_LIST_SIGNATURE
56// Link is the linked list data.
57// Version is the versions of the ACPI tables that this table belongs in.
58// Table is a pointer to the table.
59// TableSize is the size of the table
60// Handle is used to identify a particular table.
61// PoolAllocation carries the allocation type:
62// FALSE: Table points to EFI_SIZE_TO_PAGES(TableSize) pages allocated using
63// gBS->AllocatePages ()
64// TRUE: Table points to TableSize bytes allocated using gBS->AllocatePool ()
65//
66typedef struct {
67 UINT32 Signature;
68 LIST_ENTRY Link;
69 EFI_ACPI_TABLE_VERSION Version;
71 UINTN TableSize;
72 UINTN Handle;
73 BOOLEAN PoolAllocation;
75
76//
77// Containment record for ACPI Table linked list.
78//
79#define EFI_ACPI_TABLE_LIST_FROM_LINK(_link) CR (_link, EFI_ACPI_TABLE_LIST, Link, EFI_ACPI_TABLE_LIST_SIGNATURE)
80
81//
82// The maximum number of tables this driver supports
83//
84#define EFI_ACPI_MAX_NUM_TABLES 20
85
86//
87// Protocol private structure definition
88//
89//
90// ACPI support protocol instance signature definition.
91//
92#define EFI_ACPI_TABLE_SIGNATURE SIGNATURE_32 ('S', 'T', 'A', 'E')
93
94//
95// ACPI support protocol instance data structure
96//
97typedef struct {
98 UINTN Signature;
99 EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp1; // Pointer to RSD_PTR structure
100 EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp3; // Pointer to RSD_PTR structure
101 EFI_ACPI_DESCRIPTION_HEADER *Rsdt1; // Pointer to RSDT table header
102 EFI_ACPI_DESCRIPTION_HEADER *Rsdt3; // Pointer to RSDT table header
103 EFI_ACPI_DESCRIPTION_HEADER *Xsdt; // Pointer to XSDT table header
104 EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt1; // Pointer to FADT table header
105 EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt3; // Pointer to FADT table header
106 EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs1; // Pointer to FACS table header
107 EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs3; // Pointer to FACS table header
108 EFI_ACPI_DESCRIPTION_HEADER *Dsdt1; // Pointer to DSDT table header
109 EFI_ACPI_DESCRIPTION_HEADER *Dsdt3; // Pointer to DSDT table header
110 LIST_ENTRY TableList;
111 UINTN NumberOfTableEntries1; // Number of ACPI 1.0 tables
112 UINTN NumberOfTableEntries3; // Number of ACPI 3.0 tables
113 UINTN CurrentHandle;
114 EFI_ACPI_TABLE_PROTOCOL AcpiTableProtocol;
115 EFI_ACPI_SDT_PROTOCOL AcpiSdtProtocol;
116 LIST_ENTRY NotifyList;
118
119//
120// ACPI table protocol instance containing record macro
121//
122#define EFI_ACPI_TABLE_INSTANCE_FROM_THIS(a) \
123 CR (a, \
124 EFI_ACPI_TABLE_INSTANCE, \
125 AcpiTableProtocol, \
126 EFI_ACPI_TABLE_SIGNATURE \
127 )
128
129//
130// ACPI HOB produced by silicon initialization code will provide the RSDP structure.
131//
132typedef struct {
135//
136// Protocol Constructor functions
137//
138
151 EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance
152 );
153
168EFIAPI
170 IN EFI_HANDLE ImageHandle,
171 IN EFI_SYSTEM_TABLE *SystemTable
172 );
173
190 IN UINTN Handle,
191 IN LIST_ENTRY *TableList,
193 );
194
208 IN VOID *Buffer,
209 IN UINTN Size,
210 IN UINTN ChecksumOffset
211 );
212
220VOID
222 IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance,
223 IN EFI_ACPI_TABLE_VERSION Version,
224 IN UINTN Handle
225 );
226
232VOID
234 IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance
235 );
236
264 IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance,
265 IN UINTN Index,
266 OUT EFI_ACPI_SDT_HEADER **Table,
267 OUT EFI_ACPI_TABLE_VERSION *Version,
268 OUT UINTN *TableKey
269 );
270
271//
272// export PrivateData symbol, because we need that in AcpiSdtProtol implementation
273//
274extern EFI_HANDLE mHandle;
275extern EFI_ACPI_TABLE_INSTANCE *mPrivateData;
276
277#endif
UINT64 UINTN
EFI_STATUS FindTableByHandle(IN UINTN Handle, IN LIST_ENTRY *TableList, OUT EFI_ACPI_TABLE_LIST **Table)
VOID SdtAcpiTableAcpiSdtConstructor(IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance)
Definition: AcpiSdt.c:1091
EFI_STATUS EFIAPI InitializeAcpiTableDxe(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: AcpiTable.c:35
VOID SdtNotifyAcpiList(IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance, IN EFI_ACPI_TABLE_VERSION Version, IN UINTN Handle)
Definition: AcpiSdt.c:150
EFI_STATUS AcpiTableAcpiTableConstructor(EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance)
EFI_STATUS SdtGetAcpiTable(IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance, IN UINTN Index, OUT EFI_ACPI_SDT_HEADER **Table, OUT EFI_ACPI_TABLE_VERSION *Version, OUT UINTN *TableKey)
Definition: AcpiSdt.c:218
EFI_STATUS AcpiPlatformChecksum(IN VOID *Buffer, IN UINTN Size, IN UINTN ChecksumOffset)
EFI_HANDLE mHandle
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33