]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupport.h
Create PCDs in MdeModulePkg for ACPI table OEM_ID/OEM_TABLE_ID/OEM_REVISION/CREATOR_I...
[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
e84f07b5 5Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
8a96515e 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
8a96515e 82//\r
83// Protocol private structure definition\r
84//\r
85//\r
86// ACPI support protocol instance signature definition.\r
87//\r
88#define EFI_ACPI_SUPPORT_SIGNATURE SIGNATURE_32 ('S', 'S', 'A', 'E')\r
89\r
90//\r
91// ACPI support protocol instance data structure\r
92//\r
93typedef struct {\r
94 UINTN Signature;\r
95 EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp1; // Pointer to RSD_PTR structure\r
96 EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp3; // Pointer to RSD_PTR structure\r
97 EFI_ACPI_DESCRIPTION_HEADER *Rsdt1; // Pointer to RSDT table header\r
98 EFI_ACPI_DESCRIPTION_HEADER *Rsdt3; // Pointer to RSDT table header\r
99 EFI_ACPI_DESCRIPTION_HEADER *Xsdt; // Pointer to XSDT table header\r
100 EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt1; // Pointer to FADT table header\r
101 EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt3; // Pointer to FADT table header\r
102 EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs1; // Pointer to FACS table header\r
103 EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs3; // Pointer to FACS table header\r
104 EFI_ACPI_DESCRIPTION_HEADER *Dsdt1; // Pointer to DSDT table header\r
105 EFI_ACPI_DESCRIPTION_HEADER *Dsdt3; // Pointer to DSDT table header\r
106 LIST_ENTRY TableList;\r
107 UINTN NumberOfTableEntries1; // Number of ACPI 1.0 tables\r
108 UINTN NumberOfTableEntries3; // Number of ACPI 3.0 tables\r
109 UINTN CurrentHandle;\r
110 BOOLEAN TablesInstalled1; // ACPI 1.0 tables published\r
111 BOOLEAN TablesInstalled3; // ACPI 3.0 tables published\r
112 EFI_ACPI_SUPPORT_PROTOCOL AcpiSupport;\r
113 EFI_ACPI_TABLE_PROTOCOL AcpiTableProtocol;\r
114} EFI_ACPI_SUPPORT_INSTANCE;\r
115\r
116//\r
117// ACPI support protocol instance containing record macro\r
118//\r
119#define EFI_ACPI_SUPPORT_INSTANCE_FROM_ACPI_SUPPORT_THIS(a) \\r
120 CR (a, \\r
121 EFI_ACPI_SUPPORT_INSTANCE, \\r
122 AcpiSupport, \\r
123 EFI_ACPI_SUPPORT_SIGNATURE \\r
124 )\r
125//\r
126// ACPI table protocol instance containing record macro\r
127//\r
128#define EFI_ACPI_TABLE_INSTANCE_FROM_ACPI_SUPPORT_THIS(a) \\r
129 CR (a, \\r
130 EFI_ACPI_SUPPORT_INSTANCE, \\r
131 AcpiTableProtocol, \\r
132 EFI_ACPI_SUPPORT_SIGNATURE \\r
133 )\r
134 \r
135/**\r
136 Constructor for the ACPI support protocol. \r
137 \r
138 Constructor for the ACPI support protocol to initializes instance data.\r
139 \r
140 @param AcpiSupportInstance Instance to construct\r
141\r
142 @retval EFI_SUCCESS Instance initialized.\r
143 @retval EFI_OUT_OF_RESOURCES Unable to allocate required resources.\r
144**/\r
145EFI_STATUS\r
146AcpiSupportAcpiSupportConstructor (\r
147 IN EFI_ACPI_SUPPORT_INSTANCE *AcpiSupportInstance\r
148 );\r
149/**\r
150 Entry point of the ACPI support driver. This function creates and initializes an instance of the ACPI Support \r
151 Protocol and installs it on a new handle.\r
152\r
153 @param ImageHandle A handle for the image that is initializing this driver\r
154 @param SystemTable A pointer to the EFI system table \r
155\r
156 @retval EFI_SUCCESS Driver initialized successfully\r
157 @retval EFI_LOAD_ERROR Failed to Initialize or has been loaded \r
158 @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources\r
159**/\r
160EFI_STATUS\r
161EFIAPI\r
162InstallAcpiSupport (\r
163 IN EFI_HANDLE ImageHandle,\r
164 IN EFI_SYSTEM_TABLE *SystemTable\r
165 );\r
166#endif\r