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