]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/AcpiSystemDescriptionTable.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Include / Protocol / AcpiSystemDescriptionTable.h
CommitLineData
ec25b43f 1/** @file\r
2 This protocol provides services for creating ACPI system description tables.\r
ec25b43f 3\r
9095d37b 4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
ec25b43f 6\r
497a5fb1
SZ
7 @par Revision Reference:\r
8 This Protocol was introduced in PI Specification 1.2.\r
9\r
ec25b43f 10**/\r
11\r
12#ifndef __ACPI_SYSTEM_DESCRIPTION_TABLE_H___\r
13#define __ACPI_SYSTEM_DESCRIPTION_TABLE_H___\r
14\r
15#define EFI_ACPI_SDT_PROTOCOL_GUID \\r
16 { 0xeb97088e, 0xcfdf, 0x49c6, { 0xbe, 0x4b, 0xd9, 0x6, 0xa5, 0xb2, 0xe, 0x86 }}\r
9095d37b 17\r
ec25b43f 18typedef UINT32 EFI_ACPI_TABLE_VERSION;\r
19typedef VOID *EFI_ACPI_HANDLE;\r
20\r
2f88bd3a
MK
21#define EFI_ACPI_TABLE_VERSION_NONE (1 << 0)\r
22#define EFI_ACPI_TABLE_VERSION_1_0B (1 << 1)\r
23#define EFI_ACPI_TABLE_VERSION_2_0 (1 << 2)\r
24#define EFI_ACPI_TABLE_VERSION_3_0 (1 << 3)\r
25#define EFI_ACPI_TABLE_VERSION_4_0 (1 << 4)\r
26#define EFI_ACPI_TABLE_VERSION_5_0 (1 << 5)\r
9095d37b 27\r
ec25b43f 28typedef UINT32 EFI_ACPI_DATA_TYPE;\r
29#define EFI_ACPI_DATA_TYPE_NONE 0\r
30#define EFI_ACPI_DATA_TYPE_OPCODE 1\r
31#define EFI_ACPI_DATA_TYPE_NAME_STRING 2\r
32#define EFI_ACPI_DATA_TYPE_OP 3\r
33#define EFI_ACPI_DATA_TYPE_UINT 4\r
34#define EFI_ACPI_DATA_TYPE_STRING 5\r
35#define EFI_ACPI_DATA_TYPE_CHILD 6\r
9095d37b 36\r
ec25b43f 37typedef struct {\r
38 UINT32 Signature;\r
39 UINT32 Length;\r
40 UINT8 Revision;\r
41 UINT8 Checksum;\r
42 CHAR8 OemId[6];\r
43 CHAR8 OemTableId[8];\r
44 UINT32 OemRevision;\r
45 UINT32 CreatorId;\r
46 UINT32 CreatorRevision;\r
47} EFI_ACPI_SDT_HEADER;\r
9095d37b 48\r
ec25b43f 49typedef\r
50EFI_STATUS\r
51(EFIAPI *EFI_ACPI_NOTIFICATION_FN)(\r
52 IN EFI_ACPI_SDT_HEADER *Table, ///< A pointer to the ACPI table header.\r
53 IN EFI_ACPI_TABLE_VERSION Version, ///< The ACPI table's version.\r
54 IN UINTN TableKey ///< The table key for this ACPI table.\r
2f88bd3a 55 );\r
9095d37b 56\r
ec25b43f 57/**\r
58 Returns a requested ACPI table.\r
9095d37b 59\r
ec25b43f 60 The GetAcpiTable() function returns a pointer to a buffer containing the ACPI table associated\r
61 with the Index that was input. The following structures are not considered elements in the list of\r
62 ACPI tables:\r
63 - Root System Description Pointer (RSD_PTR)\r
64 - Root System Description Table (RSDT)\r
65 - Extended System Description Table (XSDT)\r
66 Version is updated with a bit map containing all the versions of ACPI of which the table is a\r
9fd7ebf9
SZ
67 member. For tables installed via the EFI_ACPI_TABLE_PROTOCOL.InstallAcpiTable() interface,\r
68 the function returns the value of EFI_ACPI_STD_PROTOCOL.AcpiVersion.\r
9095d37b 69\r
ec25b43f 70 @param[in] Index The zero-based index of the table to retrieve.\r
71 @param[out] Table Pointer for returning the table buffer.\r
72 @param[out] Version On return, updated with the ACPI versions to which this table belongs. Type\r
73 EFI_ACPI_TABLE_VERSION is defined in "Related Definitions" in the\r
9095d37b 74 EFI_ACPI_SDT_PROTOCOL.\r
9fd7ebf9
SZ
75 @param[out] TableKey On return, points to the table key for the specified ACPI system definition table.\r
76 This is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL.\r
77 The TableKey can be passed to EFI_ACPI_TABLE_PROTOCOL.UninstallAcpiTable()\r
78 to uninstall the table.\r
79\r
ec25b43f 80 @retval EFI_SUCCESS The function completed successfully.\r
9095d37b
LG
81 @retval EFI_NOT_FOUND The requested index is too large and a table was not found.\r
82**/\r
ec25b43f 83typedef\r
84EFI_STATUS\r
89b11f05 85(EFIAPI *EFI_ACPI_GET_ACPI_TABLE2)(\r
ec25b43f 86 IN UINTN Index,\r
87 OUT EFI_ACPI_SDT_HEADER **Table,\r
88 OUT EFI_ACPI_TABLE_VERSION *Version,\r
89 OUT UINTN *TableKey\r
2f88bd3a 90 );\r
ec25b43f 91\r
92/**\r
93 Register or unregister a callback when an ACPI table is installed.\r
9095d37b 94\r
ec25b43f 95 This function registers or unregisters a function which will be called whenever a new ACPI table is\r
96 installed.\r
9095d37b 97\r
ec25b43f 98 @param[in] Register If TRUE, then the specified function will be registered. If FALSE, then the specified\r
99 function will be unregistered.\r
100 @param[in] Notification Points to the callback function to be registered or unregistered.\r
9095d37b 101\r
ec25b43f 102 @retval EFI_SUCCESS Callback successfully registered or unregistered.\r
103 @retval EFI_INVALID_PARAMETER Notification is NULL\r
9095d37b 104 @retval EFI_INVALID_PARAMETER Register is FALSE and Notification does not match a known registration function.\r
ec25b43f 105**/\r
106typedef\r
107EFI_STATUS\r
108(EFIAPI *EFI_ACPI_REGISTER_NOTIFY)(\r
109 IN BOOLEAN Register,\r
110 IN EFI_ACPI_NOTIFICATION_FN Notification\r
2f88bd3a 111 );\r
ec25b43f 112\r
113/**\r
114 Create a handle from an ACPI opcode\r
9095d37b 115\r
ec25b43f 116 @param[in] Buffer Points to the ACPI opcode.\r
117 @param[out] Handle Upon return, holds the handle.\r
9095d37b 118\r
ec25b43f 119 @retval EFI_SUCCESS Success\r
120 @retval EFI_INVALID_PARAMETER Buffer is NULL or Handle is NULL or Buffer points to an\r
121 invalid opcode.\r
9095d37b 122\r
ec25b43f 123**/\r
124typedef\r
125EFI_STATUS\r
126(EFIAPI *EFI_ACPI_OPEN)(\r
127 IN VOID *Buffer,\r
9095d37b 128 OUT EFI_ACPI_HANDLE *Handle\r
2f88bd3a 129 );\r
ec25b43f 130\r
131/**\r
132 Create a handle for the first ACPI opcode in an ACPI system description table.\r
9095d37b 133\r
ec25b43f 134 @param[in] TableKey The table key for the ACPI table, as returned by GetTable().\r
135 @param[out] Handle On return, points to the newly created ACPI handle.\r
136\r
137 @retval EFI_SUCCESS Handle created successfully.\r
9095d37b 138 @retval EFI_NOT_FOUND TableKey does not refer to a valid ACPI table.\r
ec25b43f 139**/\r
140typedef\r
141EFI_STATUS\r
142(EFIAPI *EFI_ACPI_OPEN_SDT)(\r
143 IN UINTN TableKey,\r
144 OUT EFI_ACPI_HANDLE *Handle\r
2f88bd3a 145 );\r
ec25b43f 146\r
147/**\r
148 Close an ACPI handle.\r
9095d37b 149\r
ec25b43f 150 @param[in] Handle Returns the handle.\r
9095d37b 151\r
ec25b43f 152 @retval EFI_SUCCESS Success\r
9095d37b 153 @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.\r
ec25b43f 154**/\r
155typedef\r
156EFI_STATUS\r
157(EFIAPI *EFI_ACPI_CLOSE)(\r
158 IN EFI_ACPI_HANDLE Handle\r
2f88bd3a 159 );\r
ec25b43f 160\r
161/**\r
162 Return the child ACPI objects.\r
9095d37b 163\r
ec25b43f 164 @param[in] ParentHandle Parent handle.\r
165 @param[in, out] Handle On entry, points to the previously returned handle or NULL to start with the first\r
166 handle. On return, points to the next returned ACPI handle or NULL if there are no\r
167 child objects.\r
168\r
169 @retval EFI_SUCCESS Success\r
9095d37b 170 @retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object.\r
ec25b43f 171**/\r
172typedef\r
173EFI_STATUS\r
174(EFIAPI *EFI_ACPI_GET_CHILD)(\r
175 IN EFI_ACPI_HANDLE ParentHandle,\r
176 IN OUT EFI_ACPI_HANDLE *Handle\r
2f88bd3a 177 );\r
ec25b43f 178\r
179/**\r
180 Retrieve information about an ACPI object.\r
9095d37b 181\r
ec25b43f 182 @param[in] Handle ACPI object handle.\r
183 @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right\r
184 in the ACPI encoding, with index 0 always being the ACPI opcode.\r
185 @param[out] DataType Points to the returned data type or EFI_ACPI_DATA_TYPE_NONE if no data exists\r
186 for the specified index.\r
187 @param[out] Data Upon return, points to the pointer to the data.\r
188 @param[out] DataSize Upon return, points to the size of Data.\r
9095d37b
LG
189\r
190 @retval\r
ec25b43f 191**/\r
192typedef\r
193EFI_STATUS\r
194(EFIAPI *EFI_ACPI_GET_OPTION)(\r
195 IN EFI_ACPI_HANDLE Handle,\r
196 IN UINTN Index,\r
197 OUT EFI_ACPI_DATA_TYPE *DataType,\r
198 OUT CONST VOID **Data,\r
199 OUT UINTN *DataSize\r
2f88bd3a 200 );\r
ec25b43f 201\r
202/**\r
203 Change information about an ACPI object.\r
9095d37b 204\r
ec25b43f 205 @param[in] Handle ACPI object handle.\r
206 @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right\r
207 in the ACPI encoding, with index 0 always being the ACPI opcode.\r
208 @param[in] Data Points to the data.\r
209 @param[in] DataSize The size of the Data.\r
210\r
211 @retval EFI_SUCCESS Success\r
212 @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.\r
213 @retval EFI_BAD_BUFFER_SIZE Data cannot be accommodated in the space occupied by\r
214 the option.\r
215\r
216**/\r
217typedef\r
218EFI_STATUS\r
219(EFIAPI *EFI_ACPI_SET_OPTION)(\r
220 IN EFI_ACPI_HANDLE Handle,\r
221 IN UINTN Index,\r
222 IN CONST VOID *Data,\r
223 IN UINTN DataSize\r
2f88bd3a 224 );\r
ec25b43f 225\r
226/**\r
227 Returns the handle of the ACPI object representing the specified ACPI path\r
9095d37b 228\r
ec25b43f 229 @param[in] HandleIn Points to the handle of the object representing the starting point for the path search.\r
230 @param[in] AcpiPath Points to the ACPI path, which conforms to the ACPI encoded path format.\r
231 @param[out] HandleOut On return, points to the ACPI object which represents AcpiPath, relative to\r
232 HandleIn.\r
9095d37b 233\r
ec25b43f 234 @retval EFI_SUCCESS Success\r
9095d37b 235 @retval EFI_INVALID_PARAMETER HandleIn is NULL or does not refer to a valid ACPI object.\r
ec25b43f 236**/\r
237typedef\r
238EFI_STATUS\r
239(EFIAPI *EFI_ACPI_FIND_PATH)(\r
240 IN EFI_ACPI_HANDLE HandleIn,\r
241 IN VOID *AcpiPath,\r
f0f78f90 242 OUT EFI_ACPI_HANDLE *HandleOut\r
2f88bd3a 243 );\r
ec25b43f 244\r
245typedef struct _EFI_ACPI_SDT_PROTOCOL {\r
246 ///\r
9fd7ebf9 247 /// A bit map containing all the ACPI versions supported by this protocol.\r
ec25b43f 248 ///\r
2f88bd3a
MK
249 EFI_ACPI_TABLE_VERSION AcpiVersion;\r
250 EFI_ACPI_GET_ACPI_TABLE2 GetAcpiTable;\r
251 EFI_ACPI_REGISTER_NOTIFY RegisterNotify;\r
252 EFI_ACPI_OPEN Open;\r
253 EFI_ACPI_OPEN_SDT OpenSdt;\r
254 EFI_ACPI_CLOSE Close;\r
255 EFI_ACPI_GET_CHILD GetChild;\r
256 EFI_ACPI_GET_OPTION GetOption;\r
257 EFI_ACPI_SET_OPTION SetOption;\r
258 EFI_ACPI_FIND_PATH FindPath;\r
ec25b43f 259} EFI_ACPI_SDT_PROTOCOL;\r
260\r
2f88bd3a 261extern EFI_GUID gEfiAcpiSdtProtocolGuid;\r
ec25b43f 262\r
263#endif // __ACPI_SYSTEM_DESCRIPTION_TABLE_H___\r