--- /dev/null
+/** @file\r
+ This protocol provides services for creating ACPI system description tables.\r
+ \r
+ Copyright (c) 2006 - 2008, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials \r
+ are licensed and made available under the terms and conditions of the BSD License \r
+ which accompanies this distribution. The full text of the license may be found at \r
+ http://opensource.org/licenses/bsd-license.php \r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+\r
+**/\r
+\r
+#ifndef __ACPI_SYSTEM_DESCRIPTION_TABLE_H___\r
+#define __ACPI_SYSTEM_DESCRIPTION_TABLE_H___\r
+\r
+#define EFI_ACPI_SDT_PROTOCOL_GUID \\r
+ { 0xeb97088e, 0xcfdf, 0x49c6, { 0xbe, 0x4b, 0xd9, 0x6, 0xa5, 0xb2, 0xe, 0x86 }}\r
+ \r
+typedef UINT32 EFI_ACPI_TABLE_VERSION;\r
+typedef VOID *EFI_ACPI_HANDLE;\r
+\r
+#define EFI_ACPI_TABLE_VERSION_NONE (1 << 0)\r
+#define EFI_ACPI_TABLE_VERSION_1_0B (1 << 1)\r
+#define EFI_ACPI_TABLE_VERSION_2_0 (1 << 2)\r
+#define EFI_ACPI_TABLE_VERSION_3_0 (1 << 3)\r
+#define EFI_ACPI_TABLE_VERSION_4_0 (1 << 4)\r
+ \r
+typedef UINT32 EFI_ACPI_DATA_TYPE;\r
+#define EFI_ACPI_DATA_TYPE_NONE 0\r
+#define EFI_ACPI_DATA_TYPE_OPCODE 1\r
+#define EFI_ACPI_DATA_TYPE_NAME_STRING 2\r
+#define EFI_ACPI_DATA_TYPE_OP 3\r
+#define EFI_ACPI_DATA_TYPE_UINT 4\r
+#define EFI_ACPI_DATA_TYPE_STRING 5\r
+#define EFI_ACPI_DATA_TYPE_CHILD 6\r
+ \r
+typedef struct {\r
+ UINT32 Signature;\r
+ UINT32 Length;\r
+ UINT8 Revision;\r
+ UINT8 Checksum;\r
+ CHAR8 OemId[6];\r
+ CHAR8 OemTableId[8];\r
+ UINT32 OemRevision;\r
+ UINT32 CreatorId;\r
+ UINT32 CreatorRevision;\r
+} EFI_ACPI_SDT_HEADER;\r
+ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_NOTIFICATION_FN)(\r
+ IN EFI_ACPI_SDT_HEADER *Table, ///< A pointer to the ACPI table header.\r
+ IN EFI_ACPI_TABLE_VERSION Version, ///< The ACPI table's version.\r
+ IN UINTN TableKey ///< The table key for this ACPI table.\r
+);\r
+ \r
+/**\r
+ Returns a requested ACPI table.\r
+ \r
+ The GetAcpiTable() function returns a pointer to a buffer containing the ACPI table associated\r
+ with the Index that was input. The following structures are not considered elements in the list of\r
+ ACPI tables:\r
+ - Root System Description Pointer (RSD_PTR)\r
+ - Root System Description Table (RSDT)\r
+ - Extended System Description Table (XSDT)\r
+ Version is updated with a bit map containing all the versions of ACPI of which the table is a\r
+ member.\r
+ \r
+ @param[in] Index The zero-based index of the table to retrieve.\r
+ @param[out] Table Pointer for returning the table buffer.\r
+ @param[out] Version On return, updated with the ACPI versions to which this table belongs. Type\r
+ EFI_ACPI_TABLE_VERSION is defined in "Related Definitions" in the\r
+ EFI_ACPI_SDT_PROTOCOL. \r
+ @param[out] TableKey On return, points to the table key for the specified ACPI system definition table. This\r
+ is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL. \r
+ \r
+ @retval EFI_SUCCESS The function completed successfully.\r
+ @retval EFI_NOT_FOUND The requested index is too large and a table was not found. \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_GET_ACPI_TABLE)(\r
+ IN UINTN Index,\r
+ OUT EFI_ACPI_SDT_HEADER **Table,\r
+ OUT EFI_ACPI_TABLE_VERSION *Version,\r
+ OUT UINTN *TableKey\r
+);\r
+\r
+/**\r
+ Register or unregister a callback when an ACPI table is installed.\r
+ \r
+ This function registers or unregisters a function which will be called whenever a new ACPI table is\r
+ installed.\r
+ \r
+ @param[in] Register If TRUE, then the specified function will be registered. If FALSE, then the specified\r
+ function will be unregistered.\r
+ @param[in] Notification Points to the callback function to be registered or unregistered.\r
+ \r
+ @retval EFI_SUCCESS Callback successfully registered or unregistered.\r
+ @retval EFI_INVALID_PARAMETER Notification is NULL\r
+ @retval EFI_INVALID_PARAMETER Register is FALSE and Notification does not match a known registration function. \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_REGISTER_NOTIFY)(\r
+ IN BOOLEAN Register,\r
+ IN EFI_ACPI_NOTIFICATION_FN Notification\r
+);\r
+\r
+/**\r
+ Create a handle from an ACPI opcode\r
+ \r
+ @param[in] Buffer Points to the ACPI opcode.\r
+ @param[out] Handle Upon return, holds the handle.\r
+ \r
+ @retval EFI_SUCCESS Success\r
+ @retval EFI_INVALID_PARAMETER Buffer is NULL or Handle is NULL or Buffer points to an\r
+ invalid opcode.\r
+ \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_OPEN)(\r
+ IN VOID *Buffer,\r
+ OUT EFI_ACPI_HANDLE *Handle \r
+);\r
+\r
+/**\r
+ Create a handle for the first ACPI opcode in an ACPI system description table.\r
+ \r
+ @param[in] TableKey The table key for the ACPI table, as returned by GetTable().\r
+ @param[out] Handle On return, points to the newly created ACPI handle.\r
+\r
+ @retval EFI_SUCCESS Handle created successfully.\r
+ @retval EFI_NOT_FOUND TableKey does not refer to a valid ACPI table. \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_OPEN_SDT)(\r
+ IN UINTN TableKey,\r
+ OUT EFI_ACPI_HANDLE *Handle\r
+);\r
+\r
+/**\r
+ Close an ACPI handle.\r
+ \r
+ @param[in] Handle Returns the handle.\r
+ \r
+ @retval EFI_SUCCESS Success\r
+ @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object. \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_CLOSE)(\r
+ IN EFI_ACPI_HANDLE Handle\r
+);\r
+\r
+/**\r
+ Return the child ACPI objects.\r
+ \r
+ @param[in] ParentHandle Parent handle.\r
+ @param[in, out] Handle On entry, points to the previously returned handle or NULL to start with the first\r
+ handle. On return, points to the next returned ACPI handle or NULL if there are no\r
+ child objects.\r
+\r
+ @retval EFI_SUCCESS Success\r
+ @retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object. \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_GET_CHILD)(\r
+ IN EFI_ACPI_HANDLE ParentHandle,\r
+ IN OUT EFI_ACPI_HANDLE *Handle\r
+);\r
+\r
+/**\r
+ Retrieve information about an ACPI object.\r
+ \r
+ @param[in] Handle ACPI object handle.\r
+ @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right\r
+ in the ACPI encoding, with index 0 always being the ACPI opcode.\r
+ @param[out] DataType Points to the returned data type or EFI_ACPI_DATA_TYPE_NONE if no data exists\r
+ for the specified index.\r
+ @param[out] Data Upon return, points to the pointer to the data.\r
+ @param[out] DataSize Upon return, points to the size of Data.\r
+ \r
+ @retval \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_GET_OPTION)(\r
+ IN EFI_ACPI_HANDLE Handle,\r
+ IN UINTN Index,\r
+ OUT EFI_ACPI_DATA_TYPE *DataType,\r
+ OUT CONST VOID **Data,\r
+ OUT UINTN *DataSize\r
+);\r
+\r
+/**\r
+ Change information about an ACPI object.\r
+ \r
+ @param[in] Handle ACPI object handle.\r
+ @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right\r
+ in the ACPI encoding, with index 0 always being the ACPI opcode.\r
+ @param[in] Data Points to the data.\r
+ @param[in] DataSize The size of the Data.\r
+\r
+ @retval EFI_SUCCESS Success\r
+ @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.\r
+ @retval EFI_BAD_BUFFER_SIZE Data cannot be accommodated in the space occupied by\r
+ the option.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_SET_OPTION)(\r
+ IN EFI_ACPI_HANDLE Handle,\r
+ IN UINTN Index,\r
+ IN CONST VOID *Data,\r
+ IN UINTN DataSize\r
+);\r
+\r
+/**\r
+ Returns the handle of the ACPI object representing the specified ACPI path\r
+ \r
+ @param[in] HandleIn Points to the handle of the object representing the starting point for the path search.\r
+ @param[in] AcpiPath Points to the ACPI path, which conforms to the ACPI encoded path format.\r
+ @param[out] HandleOut On return, points to the ACPI object which represents AcpiPath, relative to\r
+ HandleIn.\r
+ \r
+ @retval EFI_SUCCESS Success\r
+ @retval EFI_INVALID_PARAMETER HandleIn is NULL or does not refer to a valid ACPI object. \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_FIND_PATH)(\r
+ IN EFI_ACPI_HANDLE HandleIn,\r
+ IN VOID *AcpiPath,\r
+ OUT EFI_ACPI_HANDLE HandleOut\r
+);\r
+\r
+typedef struct _EFI_ACPI_SDT_PROTOCOL {\r
+ ///\r
+ /// Specifies the ACPI version supported by this protocol.\r
+ ///\r
+ EFI_ACPI_TABLE_VERSION AcpiVersion;\r
+ EFI_ACPI_GET_ACPI_TABLE GetAcpiTable;\r
+ EFI_ACPI_REGISTER_NOTIFY RegisterNotify;\r
+ EFI_ACPI_OPEN Open;\r
+ EFI_ACPI_OPEN_SDT OpenSdt;\r
+ EFI_ACPI_CLOSE Close;\r
+ EFI_ACPI_GET_CHILD GetChild;\r
+ EFI_ACPI_GET_OPTION GetOption;\r
+ EFI_ACPI_SET_OPTION SetOption;\r
+ EFI_ACPI_FIND_PATH FindPath;\r
+} EFI_ACPI_SDT_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiAcpiSdtProtocolGuid;\r
+\r
+#endif // __ACPI_SYSTEM_DESCRIPTION_TABLE_H___\r