/** @file\r
ACPI Table Protocol Driver\r
\r
- Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
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
\r
#include <Protocol/AcpiTable.h>\r
#include <Guid/Acpi.h>\r
+#include <Protocol/AcpiSystemDescriptionTable.h>\r
\r
#include <Library/BaseLib.h>\r
#include <Library/DebugLib.h>\r
//\r
#include <IndustryStandard/Acpi.h>\r
\r
-//\r
-// From Protocol/AcpiSupport.h\r
-//\r
+#include "AcpiSdt.h"\r
\r
//\r
-// ACPI Version bitmap definition:\r
-//\r
-// EFI_ACPI_TABLE_VERSION_1_0B - ACPI Version 1.0b\r
-// EFI_ACPI_TABLE_VERSION_2_0 - ACPI Version 2.0\r
-// EFI_ACPI_TABLE_VERSION_3_0 - ACPI Version 3.0\r
-// EFI_ACPI_TABLE_VERSION_NONE - No ACPI Versions. This might be used\r
-// to create memory-based operation regions or other information\r
-// that is not part of the ACPI "tree" but must still be found\r
-// in ACPI memory space and/or managed by the core ACPI driver.\r
+// Great than or equal to 2.0.\r
//\r
-// Note that EFI provides discrete GUIDs for each version of ACPI\r
-// that is supported. It is expected that each EFI GUIDed\r
-// version of ACPI will also have a corresponding bitmap\r
-// definition. This allows maintenance of separate ACPI trees\r
-// for each distinctly different version of ACPI.\r
-//\r
-#define EFI_ACPI_TABLE_VERSION UINT32\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 ACPI_TABLE_VERSION_GTE_2_0 (EFI_ACPI_TABLE_VERSION_2_0 | \\r
+ EFI_ACPI_TABLE_VERSION_3_0 | \\r
+ EFI_ACPI_TABLE_VERSION_4_0 | \\r
+ EFI_ACPI_TABLE_VERSION_5_0)\r
\r
//\r
// Private Driver Data\r
} EFI_ACPI_TABLE_LIST;\r
\r
//\r
-// Containment record for linked list.\r
+// Containment record for ACPI Table linked list.\r
//\r
#define EFI_ACPI_TABLE_LIST_FROM_LINK(_link) CR (_link, EFI_ACPI_TABLE_LIST, Link, EFI_ACPI_TABLE_LIST_SIGNATURE)\r
\r
//\r
#define EFI_ACPI_MAX_NUM_TABLES 20\r
\r
-//\r
-// ACPI table information used to initialize tables.\r
-//\r
-#define EFI_ACPI_OEM_ID "INTEL "\r
-#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64('E', 'D', 'K', '2', ' ', ' ', ' ', ' ')\r
-#define EFI_ACPI_OEM_REVISION 0x00000002\r
-#define EFI_ACPI_CREATOR_ID 0x20202020\r
-#define EFI_ACPI_CREATOR_REVISION 0x01000013\r
-\r
//\r
// Protocol private structure definition\r
//\r
EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs3; // Pointer to FACS table header\r
EFI_ACPI_DESCRIPTION_HEADER *Dsdt1; // Pointer to DSDT table header\r
EFI_ACPI_DESCRIPTION_HEADER *Dsdt3; // Pointer to DSDT table header\r
- LIST_ENTRY TableList;\r
+ LIST_ENTRY TableList;\r
UINTN NumberOfTableEntries1; // Number of ACPI 1.0 tables\r
UINTN NumberOfTableEntries3; // Number of ACPI 3.0 tables\r
UINTN CurrentHandle;\r
- BOOLEAN TablesInstalled1; // ACPI 1.0 tables published\r
- BOOLEAN TablesInstalled3; // ACPI 3.0 tables published\r
EFI_ACPI_TABLE_PROTOCOL AcpiTableProtocol;\r
+ EFI_ACPI_SDT_PROTOCOL AcpiSdtProtocol;\r
+ LIST_ENTRY NotifyList;\r
} EFI_ACPI_TABLE_INSTANCE;\r
\r
//\r
IN EFI_SYSTEM_TABLE *SystemTable\r
);\r
\r
+/**\r
+\r
+ This function finds the table specified by the handle and returns a pointer to it.\r
+ If the handle is not found, EFI_NOT_FOUND is returned and the contents of Table are\r
+ undefined.\r
+\r
+ @param[in] Handle Table to find.\r
+ @param[in] TableList Table list to search\r
+ @param[out] Table Pointer to table found. \r
+\r
+ @retval EFI_SUCCESS The function completed successfully.\r
+ @retval EFI_NOT_FOUND No table found matching the handle specified.\r
+\r
+**/\r
+EFI_STATUS\r
+FindTableByHandle (\r
+ IN UINTN Handle,\r
+ IN LIST_ENTRY *TableList,\r
+ OUT EFI_ACPI_TABLE_LIST **Table\r
+ );\r
+\r
+/**\r
+\r
+ This function calculates and updates an UINT8 checksum.\r
+\r
+ @param[in] Buffer Pointer to buffer to checksum\r
+ @param[in] Size Number of bytes to checksum\r
+ @param[in] ChecksumOffset Offset to place the checksum result in\r
+\r
+ @retval EFI_SUCCESS The function completed successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+AcpiPlatformChecksum (\r
+ IN VOID *Buffer,\r
+ IN UINTN Size,\r
+ IN UINTN ChecksumOffset\r
+ );\r
+\r
+/**\r
+ This function invokes ACPI notification.\r
+\r
+ @param[in] AcpiTableInstance Instance to AcpiTable\r
+ @param[in] Version Version(s) to set.\r
+ @param[in] Handle Handle of the table.\r
+**/\r
+VOID\r
+SdtNotifyAcpiList (\r
+ IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance,\r
+ IN EFI_ACPI_TABLE_VERSION Version,\r
+ IN UINTN Handle\r
+ );\r
+\r
+/**\r
+ This function initializes AcpiSdt protocol in ACPI table instance.\r
+\r
+ @param[in] AcpiTableInstance Instance to construct\r
+**/\r
+VOID\r
+SdtAcpiTableAcpiSdtConstructor (\r
+ IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance\r
+ );\r
+\r
+//\r
+// export PrivateData symbol, because we need that in AcpiSdtProtol implementation\r
+//\r
+extern EFI_HANDLE mHandle;\r
+extern EFI_ACPI_TABLE_INSTANCE *mPrivateData;\r
+\r
#endif\r