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