]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/AcpiSupport.h
Minor code enhancement.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / AcpiSupport.h
1 /** @file
2 This protocol provides some basic services to support publishing ACPI system tables. The
3 services handle many of the more mundane tasks that are required to publish a set of tables. The
4 services will:
5 - Generate common tables.
6 - Update the table links.
7 - Ensure that tables are properly aligned and use correct types of memory.
8 - Update checksum values and IDs.
9 - Complete the final installation of the tables.
10
11 Copyright (c) 2007, Intel Corporation
12 All rights reserved. This program and the accompanying materials
13 are licensed and made available under the terms and conditions of the BSD License
14 which accompanies this distribution. The full text of the license may be found at
15 http://opensource.org/licenses/bsd-license.php
16
17 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
18 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19
20 @par Revision Reference:
21 This Protocol is defined in Framework ACPI Specification.
22 Version 0.9.
23
24 **/
25
26 #ifndef _ACPI_SUPPORT_PROTOCOL_H_
27 #define _ACPI_SUPPORT_PROTOCOL_H_
28
29 typedef struct _EFI_ACPI_SUPPORT_PROTOCOL EFI_ACPI_SUPPORT_PROTOCOL;
30
31 //
32 // ACPI Support Protocol GUID
33 //
34 #define EFI_ACPI_SUPPORT_GUID \
35 { \
36 0xdbff9d55, 0x89b7, 0x46da, {0xbd, 0xdf, 0x67, 0x7d, 0x3d, 0xc0, 0x24, 0x1d } \
37 }
38
39 //
40 // Protocol Data Definitions
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 supported version of ACPI.
54 // It is expected that each EFI GUIDed
55 // version of ACPI will also have a corresponding bitmap
56 // definition. This bitmap definition enables 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 // Protocol Member Functions
68 //
69
70 /**
71 Returns a requested ACPI table.
72
73 @param This A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.
74 @param Index The zero-based index of the table to retrieve.
75 @param Table Pointer for returning the table buffer.
76 @param Version Updated with the ACPI versions to which this table belongs.
77 @param Handle Pointer for identifying the table.
78
79 @retval EFI_SUCCESS The function completed successfully.
80 @retval EFI_NOT_FOUND The requested index is too large and a table was not found.
81
82 **/
83 typedef
84 EFI_STATUS
85 (EFIAPI *EFI_ACPI_GET_ACPI_TABLE)(
86 IN EFI_ACPI_SUPPORT_PROTOCOL *This,
87 IN INTN Index,
88 OUT VOID **Table,
89 OUT EFI_ACPI_TABLE_VERSION *Version,
90 OUT UINTN *Handle
91 );
92
93 /**
94 Used to add, remove, or update ACPI tables.
95
96 @param This A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.
97 @param Table Pointer to the new table to add or update.
98 @param Checksum If TRUE, indicates that the checksum should be
99 calculated for this table.
100 @param Version Indicates to which version(s) of ACPI the table should be added.
101 @param Handle Pointer to the handle of the table to remove or update.
102
103 @retval EFI_SUCCESS The function completed successfully.
104 @retval EFI_INVALID_PARAMETER *Handle was zero and Table was NULL.
105 @retval EFI_ABORTED Could not complete the desired action.
106
107 **/
108 typedef
109 EFI_STATUS
110 (EFIAPI *EFI_ACPI_SET_ACPI_TABLE)(
111 IN EFI_ACPI_SUPPORT_PROTOCOL *This,
112 IN VOID *Table OPTIONAL,
113 IN BOOLEAN Checksum,
114 IN EFI_ACPI_TABLE_VERSION Version,
115 IN OUT UINTN *Handle
116 );
117
118 /**
119 Causes one or more versions of the ACPI tables to be published in
120 the EFI system configuration tables.
121
122 The PublishTables() function installs the ACPI tables for the versions that are specified in
123 Version. No tables are published for Version equal to EFI_ACPI_VERSION_NONE. Once
124 published, tables will continue to be updated as tables are modified with
125 EFI_ACPI_SUPPORT_PROTOCOL.SetAcpiTable().
126
127 @param This A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.
128 @param Version Indicates to which version(s) of ACPI the table should be published.
129
130 @retval EFI_SUCCESS The function completed successfully.
131 @retval EFI_ABORTED An error occurred and the function could not complete successfully.
132
133 **/
134 typedef
135 EFI_STATUS
136 (EFIAPI *EFI_ACPI_PUBLISH_TABLES)(
137 IN EFI_ACPI_SUPPORT_PROTOCOL *This,
138 IN EFI_ACPI_TABLE_VERSION Version
139 );
140
141 //
142 // ACPI Support Protocol
143 //
144 /**
145 This protocol provides some basic services to support publishing ACPI system
146 tables. The services handle many of the more mundane tasks that are required
147 to publish a set of tables.
148 **/
149 struct _EFI_ACPI_SUPPORT_PROTOCOL {
150 ///
151 /// Returns a table specified by an index if it exists.
152 ///
153 EFI_ACPI_GET_ACPI_TABLE GetAcpiTable;
154
155 ///
156 /// Adds, removes, or updates ACPI tables
157 ///
158 EFI_ACPI_SET_ACPI_TABLE SetAcpiTable;
159
160 ///
161 /// Publishes the ACPI tables.
162 ///
163 EFI_ACPI_PUBLISH_TABLES PublishTables;
164 };
165
166 //
167 // Extern the GUID for protocol users.
168 //
169 extern EFI_GUID gEfiAcpiSupportProtocolGuid;
170
171 #endif
172