This reverts commit
18f6d4df9ece8b91b86511bcdd1cf7da478c3627.
We realized that DXE drivers that are independent of AcpiPlatformDxe (that
is, independent of QEMU's ACPI generation), such as RamDiskDxe and
BootGraphicsResourceTableDxe, may produce and/or manipulate ACPI tables,
at driver dispatch or even at Ready To Boot.
This makes it unsafe for us to check for ACPI presence in the UEFI system
config table in a Ready To Boot callback, in order to decide about
exposing the DT.
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
#include <Library/HobLib.h>\r
#include <libfdt.h>\r
\r
#include <Library/HobLib.h>\r
#include <libfdt.h>\r
\r
-#include <Guid/EventGroup.h>\r
#include <Guid/Fdt.h>\r
#include <Guid/FdtHob.h>\r
\r
#include <Guid/Fdt.h>\r
#include <Guid/FdtHob.h>\r
\r
GetOrInsertChosenNode,\r
};\r
\r
GetOrInsertChosenNode,\r
};\r
\r
-STATIC\r
-VOID\r
-EFIAPI\r
-OnReadyToBoot (\r
- EFI_EVENT Event,\r
- VOID *Context\r
- )\r
-{\r
- EFI_STATUS Status;\r
-\r
- if (!FeaturePcdGet (PcdPureAcpiBoot)) {\r
- //\r
- // Only install the FDT as a configuration table if we want to leave it up\r
- // to the OS to decide whether it prefers ACPI over DT.\r
- //\r
- Status = gBS->InstallConfigurationTable (&gFdtTableGuid, mDeviceTreeBase);\r
- ASSERT_EFI_ERROR (Status);\r
- }\r
-\r
- gBS->CloseEvent (Event);\r
-}\r
-\r
-STATIC EFI_EVENT mReadyToBootEvent;\r
-\r
EFI_STATUS\r
EFIAPI\r
InitializeFdtClientDxe (\r
EFI_STATUS\r
EFIAPI\r
InitializeFdtClientDxe (\r
\r
DEBUG ((EFI_D_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase));\r
\r
\r
DEBUG ((EFI_D_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase));\r
\r
- Status = gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProtocolGuid,\r
- EFI_NATIVE_INTERFACE, &mFdtClientProtocol);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
+ if (!FeaturePcdGet (PcdPureAcpiBoot)) {\r
+ //\r
+ // Only install the FDT as a configuration table if we want to leave it up\r
+ // to the OS to decide whether it prefers ACPI over DT.\r
+ //\r
+ Status = gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeBase);\r
+ ASSERT_EFI_ERROR (Status);\r
- Status = gBS->CreateEventEx (\r
- EVT_NOTIFY_SIGNAL,\r
- TPL_CALLBACK,\r
- OnReadyToBoot,\r
- NULL,\r
- &gEfiEventReadyToBootGuid,\r
- &mReadyToBootEvent\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- return EFI_SUCCESS;\r
+ return gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProtocolGuid,\r
+ EFI_NATIVE_INTERFACE, &mFdtClientProtocol);\r
gFdtClientProtocolGuid ## PRODUCES\r
\r
[Guids]\r
gFdtClientProtocolGuid ## PRODUCES\r
\r
[Guids]\r
- gEfiEventReadyToBootGuid\r
gFdtHobGuid\r
gFdtTableGuid\r
\r
gFdtHobGuid\r
gFdtTableGuid\r
\r