From f53a31344372ae977820f52a6faf73e312758e40 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Thu, 3 Mar 2016 16:49:54 +0800 Subject: [PATCH] MdeModulePkg AcpiTableDxe: Don't uninstall Acpi Sdt Protocol at ReadyToLock 1. The consumer of Acpi Sdt Protocol may want to use the API after ReadyToLock. 2. The ACPI system configuration table even could be overwritten, we see little issue in leaving Acpi Sdt Protocol installed. Cc: Jiewen Yao Cc: Feng Tian Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jiewen Yao --- .../Universal/Acpi/AcpiTableDxe/AcpiSdt.c | 62 +------------------ .../Universal/Acpi/AcpiTableDxe/AcpiTable.h | 3 +- .../Acpi/AcpiTableDxe/AcpiTableDxe.inf | 5 +- 3 files changed, 3 insertions(+), 67 deletions(-) diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c index db69390075..2b3bb35625 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c @@ -1,7 +1,7 @@ /** @file ACPI Sdt Protocol Driver - Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1040,54 +1040,6 @@ FindPath ( return Status; } -/** - ExitPmAuth Protocol notification event handler. - - @param[in] Event Event whose notification function is being invoked. - @param[in] Context Pointer to the notification function's context. -**/ -VOID -EFIAPI -ExitPmAuthNotification ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - EFI_STATUS Status; - VOID *DxeSmmReadyToLock; - - // - // Add more check to locate protocol after got event, because - // the library will signal this event immediately once it is register - // just in case it is already installed. - // - Status = gBS->LocateProtocol ( - &gEfiDxeSmmReadyToLockProtocolGuid, - NULL, - &DxeSmmReadyToLock - ); - if (EFI_ERROR (Status)) { - return ; - } - - // - // Uninstall ACPI SDT protocol, so that we can make sure no one update ACPI table from API level. - // - Status = gBS->UninstallProtocolInterface ( - mHandle, - &gEfiAcpiSdtProtocolGuid, - &mPrivateData->AcpiSdtProtocol - ); - ASSERT_EFI_ERROR (Status); - - // - // Close event, so it will not be invoked again. - // - gBS->CloseEvent (Event); - - return ; -} - /** This function initializes AcpiSdt protocol in ACPI table instance. @@ -1098,22 +1050,10 @@ SdtAcpiTableAcpiSdtConstructor ( IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance ) { - VOID *Registration; InitializeListHead (&AcpiTableInstance->NotifyList); CopyMem (&AcpiTableInstance->AcpiSdtProtocol, &mAcpiSdtProtocolTemplate, sizeof(mAcpiSdtProtocolTemplate)); AcpiTableInstance->AcpiSdtProtocol.AcpiVersion = (EFI_ACPI_TABLE_VERSION)PcdGet32 (PcdAcpiExposedTableVersions); - // - // Register event for ExitPmAuth, so that we can uninstall ACPI SDT protocol after ExitPmAuth. - // - EfiCreateProtocolNotifyEvent ( - &gEfiDxeSmmReadyToLockProtocolGuid, - TPL_CALLBACK, - ExitPmAuthNotification, - NULL, - &Registration - ); - return ; } diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h index ebedefb906..d6d81ae04d 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h @@ -1,7 +1,7 @@ /** @file ACPI Table Protocol Driver - Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf index 0fb2c9cfb5..3ec39c0228 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf @@ -1,7 +1,7 @@ ## @file # ACPI Table Protocol Driver # -# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
# Copyright (c) 2016, Linaro Ltd. All rights reserved.
# This program and the accompanying materials are # licensed and made available under the terms and conditions of the BSD License @@ -73,9 +73,6 @@ [Protocols] gEfiAcpiTableProtocolGuid ## PRODUCES gEfiAcpiSdtProtocolGuid ## PRODUCES - ## NOTIFY - ## SOMETIMES_CONSUMES - gEfiDxeSmmReadyToLockProtocolGuid [Depex] TRUE