2 This protocol provides services for creating ACPI system description tables.
4 Copyright (c) 2006 - 2010, 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.
13 This does not follow public spec.
17 #ifndef __ACPI_SYSTEM_DESCRIPTION_TABLE_H___
18 #define __ACPI_SYSTEM_DESCRIPTION_TABLE_H___
20 #define EFI_ACPI_SDT_PROTOCOL_GUID \
21 { 0xeb97088e, 0xcfdf, 0x49c6, { 0xbe, 0x4b, 0xd9, 0x6, 0xa5, 0xb2, 0xe, 0x86 }}
23 typedef UINT32 EFI_ACPI_TABLE_VERSION
;
24 typedef VOID
*EFI_ACPI_HANDLE
;
26 #define EFI_ACPI_TABLE_VERSION_NONE (1 << 0)
27 #define EFI_ACPI_TABLE_VERSION_1_0B (1 << 1)
28 #define EFI_ACPI_TABLE_VERSION_2_0 (1 << 2)
29 #define EFI_ACPI_TABLE_VERSION_3_0 (1 << 3)
30 #define EFI_ACPI_TABLE_VERSION_4_0 (1 << 4)
32 typedef UINT32 EFI_ACPI_DATA_TYPE
;
33 #define EFI_ACPI_DATA_TYPE_NONE 0
34 #define EFI_ACPI_DATA_TYPE_OPCODE 1
35 #define EFI_ACPI_DATA_TYPE_NAME_STRING 2
36 #define EFI_ACPI_DATA_TYPE_OP 3
37 #define EFI_ACPI_DATA_TYPE_UINT 4
38 #define EFI_ACPI_DATA_TYPE_STRING 5
39 #define EFI_ACPI_DATA_TYPE_CHILD 6
50 UINT32 CreatorRevision
;
51 } EFI_ACPI_SDT_HEADER
;
55 (EFIAPI
*EFI_ACPI_NOTIFICATION_FN
)(
56 IN EFI_ACPI_SDT_HEADER
*Table
, ///< A pointer to the ACPI table header.
57 IN EFI_ACPI_TABLE_VERSION Version
, ///< The ACPI table's version.
58 IN UINTN TableKey
///< The table key for this ACPI table.
62 Returns a requested ACPI table.
64 The GetAcpiTable() function returns a pointer to a buffer containing the ACPI table associated
65 with the Index that was input. The following structures are not considered elements in the list of
67 - Root System Description Pointer (RSD_PTR)
68 - Root System Description Table (RSDT)
69 - Extended System Description Table (XSDT)
70 Version is updated with a bit map containing all the versions of ACPI of which the table is a
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. This
79 is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL.
81 @retval EFI_SUCCESS The function completed successfully.
82 @retval EFI_NOT_FOUND The requested index is too large and a table was not found.
86 (EFIAPI
*EFI_ACPI_GET_ACPI_TABLE2
)(
88 OUT EFI_ACPI_SDT_HEADER
**Table
,
89 OUT EFI_ACPI_TABLE_VERSION
*Version
,
94 Register or unregister a callback when an ACPI table is installed.
96 This function registers or unregisters a function which will be called whenever a new ACPI table is
99 @param[in] Register If TRUE, then the specified function will be registered. If FALSE, then the specified
100 function will be unregistered.
101 @param[in] Notification Points to the callback function to be registered or unregistered.
103 @retval EFI_SUCCESS Callback successfully registered or unregistered.
104 @retval EFI_INVALID_PARAMETER Notification is NULL
105 @retval EFI_INVALID_PARAMETER Register is FALSE and Notification does not match a known registration function.
109 (EFIAPI
*EFI_ACPI_REGISTER_NOTIFY
)(
111 IN EFI_ACPI_NOTIFICATION_FN Notification
115 Create a handle from an ACPI opcode
117 @param[in] Buffer Points to the ACPI opcode.
118 @param[out] Handle Upon return, holds the handle.
120 @retval EFI_SUCCESS Success
121 @retval EFI_INVALID_PARAMETER Buffer is NULL or Handle is NULL or Buffer points to an
127 (EFIAPI
*EFI_ACPI_OPEN
)(
129 OUT EFI_ACPI_HANDLE
*Handle
133 Create a handle for the first ACPI opcode in an ACPI system description table.
135 @param[in] TableKey The table key for the ACPI table, as returned by GetTable().
136 @param[out] Handle On return, points to the newly created ACPI handle.
138 @retval EFI_SUCCESS Handle created successfully.
139 @retval EFI_NOT_FOUND TableKey does not refer to a valid ACPI table.
143 (EFIAPI
*EFI_ACPI_OPEN_SDT
)(
145 OUT EFI_ACPI_HANDLE
*Handle
149 Close an ACPI handle.
151 @param[in] Handle Returns the handle.
153 @retval EFI_SUCCESS Success
154 @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.
158 (EFIAPI
*EFI_ACPI_CLOSE
)(
159 IN EFI_ACPI_HANDLE Handle
163 Return the child ACPI objects.
165 @param[in] ParentHandle Parent handle.
166 @param[in, out] Handle On entry, points to the previously returned handle or NULL to start with the first
167 handle. On return, points to the next returned ACPI handle or NULL if there are no
170 @retval EFI_SUCCESS Success
171 @retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object.
175 (EFIAPI
*EFI_ACPI_GET_CHILD
)(
176 IN EFI_ACPI_HANDLE ParentHandle
,
177 IN OUT EFI_ACPI_HANDLE
*Handle
181 Retrieve information about an ACPI object.
183 @param[in] Handle ACPI object handle.
184 @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right
185 in the ACPI encoding, with index 0 always being the ACPI opcode.
186 @param[out] DataType Points to the returned data type or EFI_ACPI_DATA_TYPE_NONE if no data exists
187 for the specified index.
188 @param[out] Data Upon return, points to the pointer to the data.
189 @param[out] DataSize Upon return, points to the size of Data.
195 (EFIAPI
*EFI_ACPI_GET_OPTION
)(
196 IN EFI_ACPI_HANDLE Handle
,
198 OUT EFI_ACPI_DATA_TYPE
*DataType
,
199 OUT CONST VOID
**Data
,
204 Change information about an ACPI object.
206 @param[in] Handle ACPI object handle.
207 @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right
208 in the ACPI encoding, with index 0 always being the ACPI opcode.
209 @param[in] Data Points to the data.
210 @param[in] DataSize The size of the Data.
212 @retval EFI_SUCCESS Success
213 @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.
214 @retval EFI_BAD_BUFFER_SIZE Data cannot be accommodated in the space occupied by
220 (EFIAPI
*EFI_ACPI_SET_OPTION
)(
221 IN EFI_ACPI_HANDLE Handle
,
228 Returns the handle of the ACPI object representing the specified ACPI path
230 @param[in] HandleIn Points to the handle of the object representing the starting point for the path search.
231 @param[in] AcpiPath Points to the ACPI path, which conforms to the ACPI encoded path format.
232 @param[out] HandleOut On return, points to the ACPI object which represents AcpiPath, relative to
235 @retval EFI_SUCCESS Success
236 @retval EFI_INVALID_PARAMETER HandleIn is NULL or does not refer to a valid ACPI object.
240 (EFIAPI
*EFI_ACPI_FIND_PATH
)(
241 IN EFI_ACPI_HANDLE HandleIn
,
243 OUT EFI_ACPI_HANDLE
*HandleOut
246 typedef struct _EFI_ACPI_SDT_PROTOCOL
{
248 /// Specifies the ACPI version supported by this protocol.
250 EFI_ACPI_TABLE_VERSION AcpiVersion
;
251 EFI_ACPI_GET_ACPI_TABLE2 GetAcpiTable
;
252 EFI_ACPI_REGISTER_NOTIFY RegisterNotify
;
254 EFI_ACPI_OPEN_SDT OpenSdt
;
255 EFI_ACPI_CLOSE Close
;
256 EFI_ACPI_GET_CHILD GetChild
;
257 EFI_ACPI_GET_OPTION GetOption
;
258 EFI_ACPI_SET_OPTION SetOption
;
259 EFI_ACPI_FIND_PATH FindPath
;
260 } EFI_ACPI_SDT_PROTOCOL
;
262 extern EFI_GUID gEfiAcpiSdtProtocolGuid
;
264 #endif // __ACPI_SYSTEM_DESCRIPTION_TABLE_H___