\r
#include "DmaProtection.h"\r
\r
-EFI_ACPI_SDT_PROTOCOL *mAcpiSdt;\r
UINT64 mBelow4GMemoryLimit;\r
UINT64 mAbove4GMemoryLimit;\r
\r
//\r
// 1. setup\r
//\r
- DEBUG ((DEBUG_INFO, "GetDmarAcpiTable\n"));\r
- Status = GetDmarAcpiTable ();\r
- if (EFI_ERROR (Status)) {\r
- return;\r
- }\r
DEBUG ((DEBUG_INFO, "ParseDmarAcpiTable\n"));\r
Status = ParseDmarAcpiTableDrhd ();\r
if (EFI_ERROR (Status)) {\r
}\r
\r
/**\r
- ACPI notification function.\r
+ Notification function of ACPI Table change.\r
+\r
+ This is a notification function registered on ACPI Table change event.\r
\r
- @param[in] Table A pointer to the ACPI table header.\r
- @param[in] Version The ACPI table's version.\r
- @param[in] TableKey The table key for this ACPI table.\r
+ @param Event Event whose notification function is being invoked.\r
+ @param Context Pointer to the notification function's context.\r
\r
- @retval EFI_SUCCESS The notification function is executed.\r
**/\r
-EFI_STATUS\r
+VOID\r
EFIAPI\r
AcpiNotificationFunc (\r
- IN EFI_ACPI_SDT_HEADER *Table,\r
- IN EFI_ACPI_TABLE_VERSION Version,\r
- IN UINTN TableKey\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
)\r
{\r
- if (Table->Signature == EFI_ACPI_4_0_DMA_REMAPPING_TABLE_SIGNATURE) {\r
- DEBUG((DEBUG_INFO, "Vtd AcpiNotificationFunc\n"));\r
- SetupVtd ();\r
+ EFI_STATUS Status;\r
+\r
+ Status = GetDmarAcpiTable ();\r
+ if (EFI_ERROR (Status)) {\r
+ return;\r
}\r
- return EFI_SUCCESS;\r
+ SetupVtd ();\r
+ gBS->CloseEvent (Event);\r
}\r
\r
/**\r
EFI_STATUS Status;\r
EFI_EVENT ExitBootServicesEvent;\r
EFI_EVENT LegacyBootEvent;\r
-\r
- Status = gBS->LocateProtocol (&gEfiAcpiSdtProtocolGuid, NULL, (VOID **) &mAcpiSdt);\r
+ EFI_EVENT Event;\r
+ \r
+ Status = gBS->CreateEventEx (\r
+ EVT_NOTIFY_SIGNAL,\r
+ TPL_CALLBACK,\r
+ AcpiNotificationFunc,\r
+ NULL,\r
+ &gEfiAcpi10TableGuid,\r
+ &Event\r
+ );\r
ASSERT_EFI_ERROR (Status);\r
\r
- Status = mAcpiSdt->RegisterNotify (TRUE, AcpiNotificationFunc);\r
+ Status = gBS->CreateEventEx (\r
+ EVT_NOTIFY_SIGNAL,\r
+ TPL_CALLBACK,\r
+ AcpiNotificationFunc,\r
+ NULL,\r
+ &gEfiAcpi20TableGuid,\r
+ &Event\r
+ );\r
ASSERT_EFI_ERROR (Status);\r
\r
Status = gBS->CreateEventEx (\r