]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupport.h
IntelFrameworkModulePkg: Replace BSD License with BSD+Patent License
[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
0a6f4824 5Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
8a96515e 6\r
c0a00b14 7SPDX-License-Identifier: BSD-2-Clause-Patent\r
8a96515e 8\r
9**/\r
10\r
11#ifndef _ACPI_SUPPORT_H_\r
12#define _ACPI_SUPPORT_H_\r
13\r
14\r
15#include <PiDxe.h>\r
16\r
17#include <Protocol/AcpiTable.h>\r
18#include <Guid/Acpi.h>\r
19#include <Protocol/AcpiSupport.h>\r
20\r
21#include <Library/BaseLib.h>\r
22#include <Library/DebugLib.h>\r
23#include <Library/UefiLib.h>\r
24#include <Library/BaseMemoryLib.h>\r
25#include <Library/UefiDriverEntryPoint.h>\r
26#include <Library/MemoryAllocationLib.h>\r
27#include <Library/UefiBootServicesTableLib.h>\r
28#include <Library/PcdLib.h>\r
29\r
30//\r
31// Statements that include other files\r
32//\r
33#include <IndustryStandard/Acpi.h>\r
34\r
35\r
36//\r
37// Private Driver Data\r
38//\r
39//\r
40// ACPI Table Linked List Signature.\r
41//\r
42#define EFI_ACPI_TABLE_LIST_SIGNATURE SIGNATURE_32 ('E', 'A', 'T', 'L')\r
43\r
44//\r
45// ACPI Table Linked List Entry definition.\r
46//\r
47// Signature must be set to EFI_ACPI_TABLE_LIST_SIGNATURE\r
48// Link is the linked list data.\r
49// Version is the versions of the ACPI tables that this table belongs in.\r
50// Table is a pointer to the table.\r
51// PageAddress is the address of the pages allocated for the table.\r
52// NumberOfPages is the number of pages allocated at PageAddress.\r
53// Handle is used to identify a particular table.\r
54//\r
55typedef struct {\r
56 UINT32 Signature;\r
57 LIST_ENTRY Link;\r
58 EFI_ACPI_TABLE_VERSION Version;\r
59 EFI_ACPI_COMMON_HEADER *Table;\r
60 EFI_PHYSICAL_ADDRESS PageAddress;\r
61 UINTN NumberOfPages;\r
62 UINTN Handle;\r
63} EFI_ACPI_TABLE_LIST;\r
64\r
65//\r
66// Containment record for linked list.\r
67//\r
68#define EFI_ACPI_TABLE_LIST_FROM_LINK(_link) CR (_link, EFI_ACPI_TABLE_LIST, Link, EFI_ACPI_TABLE_LIST_SIGNATURE)\r
69\r
70//\r
71// The maximum number of tables this driver supports\r
72//\r
73#define EFI_ACPI_MAX_NUM_TABLES 20\r
74\r
8a96515e 75//\r
76// Protocol private structure definition\r
77//\r
78//\r
79// ACPI support protocol instance signature definition.\r
80//\r
81#define EFI_ACPI_SUPPORT_SIGNATURE SIGNATURE_32 ('S', 'S', 'A', 'E')\r
82\r
83//\r
84// ACPI support protocol instance data structure\r
85//\r
86typedef struct {\r
87 UINTN Signature;\r
88 EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp1; // Pointer to RSD_PTR structure\r
89 EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp3; // Pointer to RSD_PTR structure\r
90 EFI_ACPI_DESCRIPTION_HEADER *Rsdt1; // Pointer to RSDT table header\r
91 EFI_ACPI_DESCRIPTION_HEADER *Rsdt3; // Pointer to RSDT table header\r
92 EFI_ACPI_DESCRIPTION_HEADER *Xsdt; // Pointer to XSDT table header\r
93 EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt1; // Pointer to FADT table header\r
94 EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt3; // Pointer to FADT table header\r
95 EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs1; // Pointer to FACS table header\r
96 EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs3; // Pointer to FACS table header\r
97 EFI_ACPI_DESCRIPTION_HEADER *Dsdt1; // Pointer to DSDT table header\r
98 EFI_ACPI_DESCRIPTION_HEADER *Dsdt3; // Pointer to DSDT table header\r
99 LIST_ENTRY TableList;\r
100 UINTN NumberOfTableEntries1; // Number of ACPI 1.0 tables\r
101 UINTN NumberOfTableEntries3; // Number of ACPI 3.0 tables\r
102 UINTN CurrentHandle;\r
103 BOOLEAN TablesInstalled1; // ACPI 1.0 tables published\r
104 BOOLEAN TablesInstalled3; // ACPI 3.0 tables published\r
105 EFI_ACPI_SUPPORT_PROTOCOL AcpiSupport;\r
106 EFI_ACPI_TABLE_PROTOCOL AcpiTableProtocol;\r
107} EFI_ACPI_SUPPORT_INSTANCE;\r
108\r
109//\r
110// ACPI support protocol instance containing record macro\r
111//\r
112#define EFI_ACPI_SUPPORT_INSTANCE_FROM_ACPI_SUPPORT_THIS(a) \\r
113 CR (a, \\r
114 EFI_ACPI_SUPPORT_INSTANCE, \\r
115 AcpiSupport, \\r
116 EFI_ACPI_SUPPORT_SIGNATURE \\r
117 )\r
118//\r
119// ACPI table protocol instance containing record macro\r
120//\r
121#define EFI_ACPI_TABLE_INSTANCE_FROM_ACPI_SUPPORT_THIS(a) \\r
122 CR (a, \\r
123 EFI_ACPI_SUPPORT_INSTANCE, \\r
124 AcpiTableProtocol, \\r
125 EFI_ACPI_SUPPORT_SIGNATURE \\r
126 )\r
0a6f4824 127\r
8a96515e 128/**\r
0a6f4824
LG
129 Constructor for the ACPI support protocol.\r
130\r
8a96515e 131 Constructor for the ACPI support protocol to initializes instance data.\r
0a6f4824 132\r
8a96515e 133 @param AcpiSupportInstance Instance to construct\r
134\r
135 @retval EFI_SUCCESS Instance initialized.\r
136 @retval EFI_OUT_OF_RESOURCES Unable to allocate required resources.\r
137**/\r
138EFI_STATUS\r
139AcpiSupportAcpiSupportConstructor (\r
140 IN EFI_ACPI_SUPPORT_INSTANCE *AcpiSupportInstance\r
141 );\r
142/**\r
0a6f4824 143 Entry point of the ACPI support driver. This function creates and initializes an instance of the ACPI Support\r
8a96515e 144 Protocol and installs it on a new handle.\r
145\r
146 @param ImageHandle A handle for the image that is initializing this driver\r
0a6f4824 147 @param SystemTable A pointer to the EFI system table\r
8a96515e 148\r
149 @retval EFI_SUCCESS Driver initialized successfully\r
0a6f4824 150 @retval EFI_LOAD_ERROR Failed to Initialize or has been loaded\r
8a96515e 151 @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources\r
152**/\r
153EFI_STATUS\r
154EFIAPI\r
155InstallAcpiSupport (\r
156 IN EFI_HANDLE ImageHandle,\r
157 IN EFI_SYSTEM_TABLE *SystemTable\r
158 );\r
159#endif\r