2 This protocol provides services for creating ACPI system description tables.
4 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
5 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_SYSTEM_DESCRIPTION_TABLE_H___
16 #define __ACPI_SYSTEM_DESCRIPTION_TABLE_H___
18 #define EFI_ACPI_SDT_PROTOCOL_GUID \
19 { 0xeb97088e, 0xcfdf, 0x49c6, { 0xbe, 0x4b, 0xd9, 0x6, 0xa5, 0xb2, 0xe, 0x86 }}
21 typedef UINT32 EFI_ACPI_TABLE_VERSION
;
22 typedef VOID
*EFI_ACPI_HANDLE
;
24 #define EFI_ACPI_TABLE_VERSION_NONE (1 << 0)
25 #define EFI_ACPI_TABLE_VERSION_1_0B (1 << 1)
26 #define EFI_ACPI_TABLE_VERSION_2_0 (1 << 2)
27 #define EFI_ACPI_TABLE_VERSION_3_0 (1 << 3)
28 #define EFI_ACPI_TABLE_VERSION_4_0 (1 << 4)
29 #define EFI_ACPI_TABLE_VERSION_5_0 (1 << 5)
31 typedef UINT32 EFI_ACPI_DATA_TYPE
;
32 #define EFI_ACPI_DATA_TYPE_NONE 0
33 #define EFI_ACPI_DATA_TYPE_OPCODE 1
34 #define EFI_ACPI_DATA_TYPE_NAME_STRING 2
35 #define EFI_ACPI_DATA_TYPE_OP 3
36 #define EFI_ACPI_DATA_TYPE_UINT 4
37 #define EFI_ACPI_DATA_TYPE_STRING 5
38 #define EFI_ACPI_DATA_TYPE_CHILD 6
49 UINT32 CreatorRevision
;
50 } EFI_ACPI_SDT_HEADER
;
54 (EFIAPI
*EFI_ACPI_NOTIFICATION_FN
)(
55 IN EFI_ACPI_SDT_HEADER
*Table
, ///< A pointer to the ACPI table header.
56 IN EFI_ACPI_TABLE_VERSION Version
, ///< The ACPI table's version.
57 IN UINTN TableKey
///< The table key for this ACPI table.
61 Returns a requested ACPI table.
63 The GetAcpiTable() function returns a pointer to a buffer containing the ACPI table associated
64 with the Index that was input. The following structures are not considered elements in the list of
66 - Root System Description Pointer (RSD_PTR)
67 - Root System Description Table (RSDT)
68 - Extended System Description Table (XSDT)
69 Version is updated with a bit map containing all the versions of ACPI of which the table is a
70 member. For tables installed via the EFI_ACPI_TABLE_PROTOCOL.InstallAcpiTable() interface,
71 the function returns the value of EFI_ACPI_STD_PROTOCOL.AcpiVersion.
73 @param[in] Index The zero-based index of the table to retrieve.
74 @param[out] Table Pointer for returning the table buffer.
75 @param[out] Version On return, updated with the ACPI versions to which this table belongs. Type
76 EFI_ACPI_TABLE_VERSION is defined in "Related Definitions" in the
77 EFI_ACPI_SDT_PROTOCOL.
78 @param[out] TableKey On return, points to the table key for the specified ACPI system definition table.
79 This is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL.
80 The TableKey can be passed to EFI_ACPI_TABLE_PROTOCOL.UninstallAcpiTable()
81 to uninstall the table.
83 @retval EFI_SUCCESS The function completed successfully.
84 @retval EFI_NOT_FOUND The requested index is too large and a table was not found.
88 (EFIAPI
*EFI_ACPI_GET_ACPI_TABLE2
)(
90 OUT EFI_ACPI_SDT_HEADER
**Table
,
91 OUT EFI_ACPI_TABLE_VERSION
*Version
,
96 Register or unregister a callback when an ACPI table is installed.
98 This function registers or unregisters a function which will be called whenever a new ACPI table is
101 @param[in] Register If TRUE, then the specified function will be registered. If FALSE, then the specified
102 function will be unregistered.
103 @param[in] Notification Points to the callback function to be registered or unregistered.
105 @retval EFI_SUCCESS Callback successfully registered or unregistered.
106 @retval EFI_INVALID_PARAMETER Notification is NULL
107 @retval EFI_INVALID_PARAMETER Register is FALSE and Notification does not match a known registration function.
111 (EFIAPI
*EFI_ACPI_REGISTER_NOTIFY
)(
113 IN EFI_ACPI_NOTIFICATION_FN Notification
117 Create a handle from an ACPI opcode
119 @param[in] Buffer Points to the ACPI opcode.
120 @param[out] Handle Upon return, holds the handle.
122 @retval EFI_SUCCESS Success
123 @retval EFI_INVALID_PARAMETER Buffer is NULL or Handle is NULL or Buffer points to an
129 (EFIAPI
*EFI_ACPI_OPEN
)(
131 OUT EFI_ACPI_HANDLE
*Handle
135 Create a handle for the first ACPI opcode in an ACPI system description table.
137 @param[in] TableKey The table key for the ACPI table, as returned by GetTable().
138 @param[out] Handle On return, points to the newly created ACPI handle.
140 @retval EFI_SUCCESS Handle created successfully.
141 @retval EFI_NOT_FOUND TableKey does not refer to a valid ACPI table.
145 (EFIAPI
*EFI_ACPI_OPEN_SDT
)(
147 OUT EFI_ACPI_HANDLE
*Handle
151 Close an ACPI handle.
153 @param[in] Handle Returns the handle.
155 @retval EFI_SUCCESS Success
156 @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.
160 (EFIAPI
*EFI_ACPI_CLOSE
)(
161 IN EFI_ACPI_HANDLE Handle
165 Return the child ACPI objects.
167 @param[in] ParentHandle Parent handle.
168 @param[in, out] Handle On entry, points to the previously returned handle or NULL to start with the first
169 handle. On return, points to the next returned ACPI handle or NULL if there are no
172 @retval EFI_SUCCESS Success
173 @retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object.
177 (EFIAPI
*EFI_ACPI_GET_CHILD
)(
178 IN EFI_ACPI_HANDLE ParentHandle
,
179 IN OUT EFI_ACPI_HANDLE
*Handle
183 Retrieve information about an ACPI object.
185 @param[in] Handle ACPI object handle.
186 @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right
187 in the ACPI encoding, with index 0 always being the ACPI opcode.
188 @param[out] DataType Points to the returned data type or EFI_ACPI_DATA_TYPE_NONE if no data exists
189 for the specified index.
190 @param[out] Data Upon return, points to the pointer to the data.
191 @param[out] DataSize Upon return, points to the size of Data.
197 (EFIAPI
*EFI_ACPI_GET_OPTION
)(
198 IN EFI_ACPI_HANDLE Handle
,
200 OUT EFI_ACPI_DATA_TYPE
*DataType
,
201 OUT CONST VOID
**Data
,
206 Change information about an ACPI object.
208 @param[in] Handle ACPI object handle.
209 @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right
210 in the ACPI encoding, with index 0 always being the ACPI opcode.
211 @param[in] Data Points to the data.
212 @param[in] DataSize The size of the Data.
214 @retval EFI_SUCCESS Success
215 @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.
216 @retval EFI_BAD_BUFFER_SIZE Data cannot be accommodated in the space occupied by
222 (EFIAPI
*EFI_ACPI_SET_OPTION
)(
223 IN EFI_ACPI_HANDLE Handle
,
230 Returns the handle of the ACPI object representing the specified ACPI path
232 @param[in] HandleIn Points to the handle of the object representing the starting point for the path search.
233 @param[in] AcpiPath Points to the ACPI path, which conforms to the ACPI encoded path format.
234 @param[out] HandleOut On return, points to the ACPI object which represents AcpiPath, relative to
237 @retval EFI_SUCCESS Success
238 @retval EFI_INVALID_PARAMETER HandleIn is NULL or does not refer to a valid ACPI object.
242 (EFIAPI
*EFI_ACPI_FIND_PATH
)(
243 IN EFI_ACPI_HANDLE HandleIn
,
245 OUT EFI_ACPI_HANDLE
*HandleOut
248 typedef struct _EFI_ACPI_SDT_PROTOCOL
{
250 /// A bit map containing all the ACPI versions supported by this protocol.
252 EFI_ACPI_TABLE_VERSION AcpiVersion
;
253 EFI_ACPI_GET_ACPI_TABLE2 GetAcpiTable
;
254 EFI_ACPI_REGISTER_NOTIFY RegisterNotify
;
256 EFI_ACPI_OPEN_SDT OpenSdt
;
257 EFI_ACPI_CLOSE Close
;
258 EFI_ACPI_GET_CHILD GetChild
;
259 EFI_ACPI_GET_OPTION GetOption
;
260 EFI_ACPI_SET_OPTION SetOption
;
261 EFI_ACPI_FIND_PATH FindPath
;
262 } EFI_ACPI_SDT_PROTOCOL
;
264 extern EFI_GUID gEfiAcpiSdtProtocolGuid
;
266 #endif // __ACPI_SYSTEM_DESCRIPTION_TABLE_H___