]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h
Remove svn:executable on *.c, *.h, *.asm, *.S, *.inf and *.asl*
[mirror_edk2.git] / MdeModulePkg / Universal / Acpi / AcpiTableDxe / AcpiTable.h
1 /** @file
2 ACPI Table Protocol Driver
3
4 Copyright (c) 2006 - 2009, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _ACPI_TABLE_H_
16 #define _ACPI_TABLE_H_
17
18
19 #include <PiDxe.h>
20
21 #include <Protocol/AcpiTable.h>
22 #include <Guid/Acpi.h>
23
24 #include <Library/BaseLib.h>
25 #include <Library/DebugLib.h>
26 #include <Library/UefiLib.h>
27 #include <Library/BaseMemoryLib.h>
28 #include <Library/UefiDriverEntryPoint.h>
29 #include <Library/MemoryAllocationLib.h>
30 #include <Library/UefiBootServicesTableLib.h>
31 #include <Library/PcdLib.h>
32
33 //
34 // Statements that include other files
35 //
36 #include <IndustryStandard/Acpi.h>
37
38 //
39 // From Protocol/AcpiSupport.h
40 //
41
42 //
43 // ACPI Version bitmap definition:
44 //
45 // EFI_ACPI_TABLE_VERSION_1_0B - ACPI Version 1.0b
46 // EFI_ACPI_TABLE_VERSION_2_0 - ACPI Version 2.0
47 // EFI_ACPI_TABLE_VERSION_3_0 - ACPI Version 3.0
48 // EFI_ACPI_TABLE_VERSION_NONE - No ACPI Versions. This might be used
49 // to create memory-based operation regions or other information
50 // that is not part of the ACPI "tree" but must still be found
51 // in ACPI memory space and/or managed by the core ACPI driver.
52 //
53 // Note that EFI provides discrete GUIDs for each version of ACPI
54 // that is supported. It is expected that each EFI GUIDed
55 // version of ACPI will also have a corresponding bitmap
56 // definition. This allows maintenance of separate ACPI trees
57 // for each distinctly different version of ACPI.
58 //
59 #define EFI_ACPI_TABLE_VERSION UINT32
60
61 #define EFI_ACPI_TABLE_VERSION_NONE (1 << 0)
62 #define EFI_ACPI_TABLE_VERSION_1_0B (1 << 1)
63 #define EFI_ACPI_TABLE_VERSION_2_0 (1 << 2)
64 #define EFI_ACPI_TABLE_VERSION_3_0 (1 << 3)
65
66 //
67 // Private Driver Data
68 //
69 //
70 // ACPI Table Linked List Signature.
71 //
72 #define EFI_ACPI_TABLE_LIST_SIGNATURE SIGNATURE_32 ('E', 'A', 'T', 'L')
73
74 //
75 // ACPI Table Linked List Entry definition.
76 //
77 // Signature must be set to EFI_ACPI_TABLE_LIST_SIGNATURE
78 // Link is the linked list data.
79 // Version is the versions of the ACPI tables that this table belongs in.
80 // Table is a pointer to the table.
81 // PageAddress is the address of the pages allocated for the table.
82 // NumberOfPages is the number of pages allocated at PageAddress.
83 // Handle is used to identify a particular table.
84 //
85 typedef struct {
86 UINT32 Signature;
87 LIST_ENTRY Link;
88 EFI_ACPI_TABLE_VERSION Version;
89 EFI_ACPI_COMMON_HEADER *Table;
90 EFI_PHYSICAL_ADDRESS PageAddress;
91 UINTN NumberOfPages;
92 UINTN Handle;
93 } EFI_ACPI_TABLE_LIST;
94
95 //
96 // Containment record for linked list.
97 //
98 #define EFI_ACPI_TABLE_LIST_FROM_LINK(_link) CR (_link, EFI_ACPI_TABLE_LIST, Link, EFI_ACPI_TABLE_LIST_SIGNATURE)
99
100 //
101 // The maximum number of tables this driver supports
102 //
103 #define EFI_ACPI_MAX_NUM_TABLES 20
104
105 //
106 // ACPI table information used to initialize tables.
107 //
108 #define EFI_ACPI_OEM_ID "INTEL "
109 #define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64('E', 'D', 'K', '2', ' ', ' ', ' ', ' ')
110 #define EFI_ACPI_OEM_REVISION 0x00000002
111 #define EFI_ACPI_CREATOR_ID 0x20202020
112 #define EFI_ACPI_CREATOR_REVISION 0x01000013
113
114 //
115 // Protocol private structure definition
116 //
117 //
118 // ACPI support protocol instance signature definition.
119 //
120 #define EFI_ACPI_TABLE_SIGNATURE SIGNATURE_32 ('S', 'T', 'A', 'E')
121
122 //
123 // ACPI support protocol instance data structure
124 //
125 typedef struct {
126 UINTN Signature;
127 EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp1; // Pointer to RSD_PTR structure
128 EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp3; // Pointer to RSD_PTR structure
129 EFI_ACPI_DESCRIPTION_HEADER *Rsdt1; // Pointer to RSDT table header
130 EFI_ACPI_DESCRIPTION_HEADER *Rsdt3; // Pointer to RSDT table header
131 EFI_ACPI_DESCRIPTION_HEADER *Xsdt; // Pointer to XSDT table header
132 EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt1; // Pointer to FADT table header
133 EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt3; // Pointer to FADT table header
134 EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs1; // Pointer to FACS table header
135 EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs3; // Pointer to FACS table header
136 EFI_ACPI_DESCRIPTION_HEADER *Dsdt1; // Pointer to DSDT table header
137 EFI_ACPI_DESCRIPTION_HEADER *Dsdt3; // Pointer to DSDT table header
138 LIST_ENTRY TableList;
139 UINTN NumberOfTableEntries1; // Number of ACPI 1.0 tables
140 UINTN NumberOfTableEntries3; // Number of ACPI 3.0 tables
141 UINTN CurrentHandle;
142 BOOLEAN TablesInstalled1; // ACPI 1.0 tables published
143 BOOLEAN TablesInstalled3; // ACPI 3.0 tables published
144 EFI_ACPI_TABLE_PROTOCOL AcpiTableProtocol;
145 } EFI_ACPI_TABLE_INSTANCE;
146
147 //
148 // ACPI table protocol instance containing record macro
149 //
150 #define EFI_ACPI_TABLE_INSTANCE_FROM_THIS(a) \
151 CR (a, \
152 EFI_ACPI_TABLE_INSTANCE, \
153 AcpiTableProtocol, \
154 EFI_ACPI_TABLE_SIGNATURE \
155 )
156
157 //
158 // Protocol Constructor functions
159 //
160
161 /**
162 Constructor for the ACPI support protocol. Initializes instance
163 data.
164
165 @param AcpiTableInstance Instance to construct
166
167 @return EFI_SUCCESS Instance initialized.
168 @return EFI_OUT_OF_RESOURCES Unable to allocate required resources.
169
170 **/
171 EFI_STATUS
172 AcpiTableAcpiTableConstructor (
173 EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance
174 );
175
176
177 /**
178 Entry point of the ACPI table driver.
179 Creates and initializes an instance of the ACPI Table
180 Protocol and installs it on a new handle.
181
182 @param ImageHandle A handle for the image that is initializing this driver
183 @param SystemTable A pointer to the EFI system table
184
185 @return EFI_SUCCESS Driver initialized successfully
186 @return EFI_LOAD_ERROR Failed to Initialize or has been loaded
187 @return EFI_OUT_OF_RESOURCES Could not allocate needed resources
188
189 **/
190 EFI_STATUS
191 EFIAPI
192 InitializeAcpiTableDxe (
193 IN EFI_HANDLE ImageHandle,
194 IN EFI_SYSTEM_TABLE *SystemTable
195 );
196
197 #endif