2 ACPI Table Protocol Driver
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
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.
15 #ifndef _ACPI_TABLE_H_
16 #define _ACPI_TABLE_H_
21 #include <Protocol/AcpiTable.h>
22 #include <Guid/Acpi.h>
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>
34 // Statements that include other files
36 #include <IndustryStandard/Acpi.h>
39 // From Protocol/AcpiSupport.h
43 // ACPI Version bitmap definition:
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.
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.
59 #define EFI_ACPI_TABLE_VERSION UINT32
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)
67 // Private Driver Data
70 // ACPI Table Linked List Signature.
72 #define EFI_ACPI_TABLE_LIST_SIGNATURE SIGNATURE_32 ('E', 'A', 'T', 'L')
75 // ACPI Table Linked List Entry definition.
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.
88 EFI_ACPI_TABLE_VERSION Version
;
89 EFI_ACPI_COMMON_HEADER
*Table
;
90 EFI_PHYSICAL_ADDRESS PageAddress
;
93 } EFI_ACPI_TABLE_LIST
;
96 // Containment record for linked list.
98 #define EFI_ACPI_TABLE_LIST_FROM_LINK(_link) CR (_link, EFI_ACPI_TABLE_LIST, Link, EFI_ACPI_TABLE_LIST_SIGNATURE)
101 // The maximum number of tables this driver supports
103 #define EFI_ACPI_MAX_NUM_TABLES 20
106 // ACPI table information used to initialize tables.
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
115 // Protocol private structure definition
118 // ACPI support protocol instance signature definition.
120 #define EFI_ACPI_TABLE_SIGNATURE SIGNATURE_32 ('S', 'T', 'A', 'E')
123 // ACPI support protocol instance data structure
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
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
;
148 // ACPI table protocol instance containing record macro
150 #define EFI_ACPI_TABLE_INSTANCE_FROM_THIS(a) \
152 EFI_ACPI_TABLE_INSTANCE, \
154 EFI_ACPI_TABLE_SIGNATURE \
158 // Protocol Constructor functions
162 Constructor for the ACPI support protocol. Initializes instance
165 @param AcpiTableInstance Instance to construct
167 @return EFI_SUCCESS Instance initialized.
168 @return EFI_OUT_OF_RESOURCES Unable to allocate required resources.
172 AcpiTableAcpiTableConstructor (
173 EFI_ACPI_TABLE_INSTANCE
*AcpiTableInstance
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.
182 @param ImageHandle A handle for the image that is initializing this driver
183 @param SystemTable A pointer to the EFI system table
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
192 InitializeAcpiTableDxe (
193 IN EFI_HANDLE ImageHandle
,
194 IN EFI_SYSTEM_TABLE
*SystemTable