]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupport.h
MdeModulePkg: Add support for weakly aligned FVs.
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / Acpi / AcpiSupportDxe / AcpiSupport.h
CommitLineData
8a96515e 1/** @file\r
2 This is an implementation of the ACPI Support protocol.\r
3 It is in compliance with the 0.9 definition of the protocol.\r
4\r
5Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
6\r
7This program and the accompanying materials\r
8are licensed and made available under the terms and conditions\r
9of the BSD License which accompanies this distribution. The\r
10full text of the license may be found at\r
11http://opensource.org/licenses/bsd-license.php\r
12\r
13THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
14WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
15\r
16**/\r
17\r
18#ifndef _ACPI_SUPPORT_H_\r
19#define _ACPI_SUPPORT_H_\r
20\r
21\r
22#include <PiDxe.h>\r
23\r
24#include <Protocol/AcpiTable.h>\r
25#include <Guid/Acpi.h>\r
26#include <Protocol/AcpiSupport.h>\r
27\r
28#include <Library/BaseLib.h>\r
29#include <Library/DebugLib.h>\r
30#include <Library/UefiLib.h>\r
31#include <Library/BaseMemoryLib.h>\r
32#include <Library/UefiDriverEntryPoint.h>\r
33#include <Library/MemoryAllocationLib.h>\r
34#include <Library/UefiBootServicesTableLib.h>\r
35#include <Library/PcdLib.h>\r
36\r
37//\r
38// Statements that include other files\r
39//\r
40#include <IndustryStandard/Acpi.h>\r
41\r
42\r
43//\r
44// Private Driver Data\r
45//\r
46//\r
47// ACPI Table Linked List Signature.\r
48//\r
49#define EFI_ACPI_TABLE_LIST_SIGNATURE SIGNATURE_32 ('E', 'A', 'T', 'L')\r
50\r
51//\r
52// ACPI Table Linked List Entry definition.\r
53//\r
54// Signature must be set to EFI_ACPI_TABLE_LIST_SIGNATURE\r
55// Link is the linked list data.\r
56// Version is the versions of the ACPI tables that this table belongs in.\r
57// Table is a pointer to the table.\r
58// PageAddress is the address of the pages allocated for the table.\r
59// NumberOfPages is the number of pages allocated at PageAddress.\r
60// Handle is used to identify a particular table.\r
61//\r
62typedef struct {\r
63 UINT32 Signature;\r
64 LIST_ENTRY Link;\r
65 EFI_ACPI_TABLE_VERSION Version;\r
66 EFI_ACPI_COMMON_HEADER *Table;\r
67 EFI_PHYSICAL_ADDRESS PageAddress;\r
68 UINTN NumberOfPages;\r
69 UINTN Handle;\r
70} EFI_ACPI_TABLE_LIST;\r
71\r
72//\r
73// Containment record for linked list.\r
74//\r
75#define EFI_ACPI_TABLE_LIST_FROM_LINK(_link) CR (_link, EFI_ACPI_TABLE_LIST, Link, EFI_ACPI_TABLE_LIST_SIGNATURE)\r
76\r
77//\r
78// The maximum number of tables this driver supports\r
79//\r
80#define EFI_ACPI_MAX_NUM_TABLES 20\r
81\r
82//\r
83// ACPI table information used to initialize tables.\r
84//\r
85#define EFI_ACPI_OEM_ID "INTEL "\r
86#define EFI_ACPI_OEM_TABLE_ID 0x2020204F4E414954ULL // "TIANO "\r
87#define EFI_ACPI_OEM_REVISION 0x00000002\r
88#define EFI_ACPI_CREATOR_ID 0x20202020\r
89#define EFI_ACPI_CREATOR_REVISION 0x01000013\r
90\r
91//\r
92// Protocol private structure definition\r
93//\r
94//\r
95// ACPI support protocol instance signature definition.\r
96//\r
97#define EFI_ACPI_SUPPORT_SIGNATURE SIGNATURE_32 ('S', 'S', 'A', 'E')\r
98\r
99//\r
100// ACPI support protocol instance data structure\r
101//\r
102typedef struct {\r
103 UINTN Signature;\r
104 EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp1; // Pointer to RSD_PTR structure\r
105 EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp3; // Pointer to RSD_PTR structure\r
106 EFI_ACPI_DESCRIPTION_HEADER *Rsdt1; // Pointer to RSDT table header\r
107 EFI_ACPI_DESCRIPTION_HEADER *Rsdt3; // Pointer to RSDT table header\r
108 EFI_ACPI_DESCRIPTION_HEADER *Xsdt; // Pointer to XSDT table header\r
109 EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt1; // Pointer to FADT table header\r
110 EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt3; // Pointer to FADT table header\r
111 EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs1; // Pointer to FACS table header\r
112 EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs3; // Pointer to FACS table header\r
113 EFI_ACPI_DESCRIPTION_HEADER *Dsdt1; // Pointer to DSDT table header\r
114 EFI_ACPI_DESCRIPTION_HEADER *Dsdt3; // Pointer to DSDT table header\r
115 LIST_ENTRY TableList;\r
116 UINTN NumberOfTableEntries1; // Number of ACPI 1.0 tables\r
117 UINTN NumberOfTableEntries3; // Number of ACPI 3.0 tables\r
118 UINTN CurrentHandle;\r
119 BOOLEAN TablesInstalled1; // ACPI 1.0 tables published\r
120 BOOLEAN TablesInstalled3; // ACPI 3.0 tables published\r
121 EFI_ACPI_SUPPORT_PROTOCOL AcpiSupport;\r
122 EFI_ACPI_TABLE_PROTOCOL AcpiTableProtocol;\r
123} EFI_ACPI_SUPPORT_INSTANCE;\r
124\r
125//\r
126// ACPI support protocol instance containing record macro\r
127//\r
128#define EFI_ACPI_SUPPORT_INSTANCE_FROM_ACPI_SUPPORT_THIS(a) \\r
129 CR (a, \\r
130 EFI_ACPI_SUPPORT_INSTANCE, \\r
131 AcpiSupport, \\r
132 EFI_ACPI_SUPPORT_SIGNATURE \\r
133 )\r
134//\r
135// ACPI table protocol instance containing record macro\r
136//\r
137#define EFI_ACPI_TABLE_INSTANCE_FROM_ACPI_SUPPORT_THIS(a) \\r
138 CR (a, \\r
139 EFI_ACPI_SUPPORT_INSTANCE, \\r
140 AcpiTableProtocol, \\r
141 EFI_ACPI_SUPPORT_SIGNATURE \\r
142 )\r
143 \r
144/**\r
145 Constructor for the ACPI support protocol. \r
146 \r
147 Constructor for the ACPI support protocol to initializes instance data.\r
148 \r
149 @param AcpiSupportInstance Instance to construct\r
150\r
151 @retval EFI_SUCCESS Instance initialized.\r
152 @retval EFI_OUT_OF_RESOURCES Unable to allocate required resources.\r
153**/\r
154EFI_STATUS\r
155AcpiSupportAcpiSupportConstructor (\r
156 IN EFI_ACPI_SUPPORT_INSTANCE *AcpiSupportInstance\r
157 );\r
158/**\r
159 Entry point of the ACPI support driver. This function creates and initializes an instance of the ACPI Support \r
160 Protocol and installs it on a new handle.\r
161\r
162 @param ImageHandle A handle for the image that is initializing this driver\r
163 @param SystemTable A pointer to the EFI system table \r
164\r
165 @retval EFI_SUCCESS Driver initialized successfully\r
166 @retval EFI_LOAD_ERROR Failed to Initialize or has been loaded \r
167 @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources\r
168**/\r
169EFI_STATUS\r
170EFIAPI\r
171InstallAcpiSupport (\r
172 IN EFI_HANDLE ImageHandle,\r
173 IN EFI_SYSTEM_TABLE *SystemTable\r
174 );\r
175#endif\r