2 This protocol provides services for creating ACPI system description tables.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
7 @par Revision Reference:
8 This Protocol was introduced in PI Specification 1.2.
12 #ifndef __ACPI_SYSTEM_DESCRIPTION_TABLE_H___
13 #define __ACPI_SYSTEM_DESCRIPTION_TABLE_H___
15 #define EFI_ACPI_SDT_PROTOCOL_GUID \
16 { 0xeb97088e, 0xcfdf, 0x49c6, { 0xbe, 0x4b, 0xd9, 0x6, 0xa5, 0xb2, 0xe, 0x86 }}
18 typedef UINT32 EFI_ACPI_TABLE_VERSION
;
19 typedef VOID
*EFI_ACPI_HANDLE
;
21 #define EFI_ACPI_TABLE_VERSION_NONE (1 << 0)
22 #define EFI_ACPI_TABLE_VERSION_1_0B (1 << 1)
23 #define EFI_ACPI_TABLE_VERSION_2_0 (1 << 2)
24 #define EFI_ACPI_TABLE_VERSION_3_0 (1 << 3)
25 #define EFI_ACPI_TABLE_VERSION_4_0 (1 << 4)
26 #define EFI_ACPI_TABLE_VERSION_5_0 (1 << 5)
28 typedef UINT32 EFI_ACPI_DATA_TYPE
;
29 #define EFI_ACPI_DATA_TYPE_NONE 0
30 #define EFI_ACPI_DATA_TYPE_OPCODE 1
31 #define EFI_ACPI_DATA_TYPE_NAME_STRING 2
32 #define EFI_ACPI_DATA_TYPE_OP 3
33 #define EFI_ACPI_DATA_TYPE_UINT 4
34 #define EFI_ACPI_DATA_TYPE_STRING 5
35 #define EFI_ACPI_DATA_TYPE_CHILD 6
46 UINT32 CreatorRevision
;
47 } EFI_ACPI_SDT_HEADER
;
51 (EFIAPI
*EFI_ACPI_NOTIFICATION_FN
)(
52 IN EFI_ACPI_SDT_HEADER
*Table
, ///< A pointer to the ACPI table header.
53 IN EFI_ACPI_TABLE_VERSION Version
, ///< The ACPI table's version.
54 IN UINTN TableKey
///< The table key for this ACPI table.
58 Returns a requested ACPI table.
60 The GetAcpiTable() function returns a pointer to a buffer containing the ACPI table associated
61 with the Index that was input. The following structures are not considered elements in the list of
63 - Root System Description Pointer (RSD_PTR)
64 - Root System Description Table (RSDT)
65 - Extended System Description Table (XSDT)
66 Version is updated with a bit map containing all the versions of ACPI of which the table is a
67 member. For tables installed via the EFI_ACPI_TABLE_PROTOCOL.InstallAcpiTable() interface,
68 the function returns the value of EFI_ACPI_STD_PROTOCOL.AcpiVersion.
70 @param[in] Index The zero-based index of the table to retrieve.
71 @param[out] Table Pointer for returning the table buffer.
72 @param[out] Version On return, updated with the ACPI versions to which this table belongs. Type
73 EFI_ACPI_TABLE_VERSION is defined in "Related Definitions" in the
74 EFI_ACPI_SDT_PROTOCOL.
75 @param[out] TableKey On return, points to the table key for the specified ACPI system definition table.
76 This is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL.
77 The TableKey can be passed to EFI_ACPI_TABLE_PROTOCOL.UninstallAcpiTable()
78 to uninstall the table.
80 @retval EFI_SUCCESS The function completed successfully.
81 @retval EFI_NOT_FOUND The requested index is too large and a table was not found.
85 (EFIAPI
*EFI_ACPI_GET_ACPI_TABLE2
)(
87 OUT EFI_ACPI_SDT_HEADER
**Table
,
88 OUT EFI_ACPI_TABLE_VERSION
*Version
,
93 Register or unregister a callback when an ACPI table is installed.
95 This function registers or unregisters a function which will be called whenever a new ACPI table is
98 @param[in] Register If TRUE, then the specified function will be registered. If FALSE, then the specified
99 function will be unregistered.
100 @param[in] Notification Points to the callback function to be registered or unregistered.
102 @retval EFI_SUCCESS Callback successfully registered or unregistered.
103 @retval EFI_INVALID_PARAMETER Notification is NULL
104 @retval EFI_INVALID_PARAMETER Register is FALSE and Notification does not match a known registration function.
108 (EFIAPI
*EFI_ACPI_REGISTER_NOTIFY
)(
110 IN EFI_ACPI_NOTIFICATION_FN Notification
114 Create a handle from an ACPI opcode
116 @param[in] Buffer Points to the ACPI opcode.
117 @param[out] Handle Upon return, holds the handle.
119 @retval EFI_SUCCESS Success
120 @retval EFI_INVALID_PARAMETER Buffer is NULL or Handle is NULL or Buffer points to an
126 (EFIAPI
*EFI_ACPI_OPEN
)(
128 OUT EFI_ACPI_HANDLE
*Handle
132 Create a handle for the first ACPI opcode in an ACPI system description table.
134 @param[in] TableKey The table key for the ACPI table, as returned by GetTable().
135 @param[out] Handle On return, points to the newly created ACPI handle.
137 @retval EFI_SUCCESS Handle created successfully.
138 @retval EFI_NOT_FOUND TableKey does not refer to a valid ACPI table.
142 (EFIAPI
*EFI_ACPI_OPEN_SDT
)(
144 OUT EFI_ACPI_HANDLE
*Handle
148 Close an ACPI handle.
150 @param[in] Handle Returns the handle.
152 @retval EFI_SUCCESS Success
153 @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.
157 (EFIAPI
*EFI_ACPI_CLOSE
)(
158 IN EFI_ACPI_HANDLE Handle
162 Return the child ACPI objects.
164 @param[in] ParentHandle Parent handle.
165 @param[in, out] Handle On entry, points to the previously returned handle or NULL to start with the first
166 handle. On return, points to the next returned ACPI handle or NULL if there are no
169 @retval EFI_SUCCESS Success
170 @retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object.
174 (EFIAPI
*EFI_ACPI_GET_CHILD
)(
175 IN EFI_ACPI_HANDLE ParentHandle
,
176 IN OUT EFI_ACPI_HANDLE
*Handle
180 Retrieve information about an ACPI object.
182 @param[in] Handle ACPI object handle.
183 @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right
184 in the ACPI encoding, with index 0 always being the ACPI opcode.
185 @param[out] DataType Points to the returned data type or EFI_ACPI_DATA_TYPE_NONE if no data exists
186 for the specified index.
187 @param[out] Data Upon return, points to the pointer to the data.
188 @param[out] DataSize Upon return, points to the size of Data.
194 (EFIAPI
*EFI_ACPI_GET_OPTION
)(
195 IN EFI_ACPI_HANDLE Handle
,
197 OUT EFI_ACPI_DATA_TYPE
*DataType
,
198 OUT CONST VOID
**Data
,
203 Change information about an ACPI object.
205 @param[in] Handle ACPI object handle.
206 @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right
207 in the ACPI encoding, with index 0 always being the ACPI opcode.
208 @param[in] Data Points to the data.
209 @param[in] DataSize The size of the Data.
211 @retval EFI_SUCCESS Success
212 @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.
213 @retval EFI_BAD_BUFFER_SIZE Data cannot be accommodated in the space occupied by
219 (EFIAPI
*EFI_ACPI_SET_OPTION
)(
220 IN EFI_ACPI_HANDLE Handle
,
227 Returns the handle of the ACPI object representing the specified ACPI path
229 @param[in] HandleIn Points to the handle of the object representing the starting point for the path search.
230 @param[in] AcpiPath Points to the ACPI path, which conforms to the ACPI encoded path format.
231 @param[out] HandleOut On return, points to the ACPI object which represents AcpiPath, relative to
234 @retval EFI_SUCCESS Success
235 @retval EFI_INVALID_PARAMETER HandleIn is NULL or does not refer to a valid ACPI object.
239 (EFIAPI
*EFI_ACPI_FIND_PATH
)(
240 IN EFI_ACPI_HANDLE HandleIn
,
242 OUT EFI_ACPI_HANDLE
*HandleOut
245 typedef struct _EFI_ACPI_SDT_PROTOCOL
{
247 /// A bit map containing all the ACPI versions supported by this protocol.
249 EFI_ACPI_TABLE_VERSION AcpiVersion
;
250 EFI_ACPI_GET_ACPI_TABLE2 GetAcpiTable
;
251 EFI_ACPI_REGISTER_NOTIFY RegisterNotify
;
253 EFI_ACPI_OPEN_SDT OpenSdt
;
254 EFI_ACPI_CLOSE Close
;
255 EFI_ACPI_GET_CHILD GetChild
;
256 EFI_ACPI_GET_OPTION GetOption
;
257 EFI_ACPI_SET_OPTION SetOption
;
258 EFI_ACPI_FIND_PATH FindPath
;
259 } EFI_ACPI_SDT_PROTOCOL
;
261 extern EFI_GUID gEfiAcpiSdtProtocolGuid
;
263 #endif // __ACPI_SYSTEM_DESCRIPTION_TABLE_H___