#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
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
\r
DEBUG ((EFI_D_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase));\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, DeviceTreeBase);\r
- ASSERT_EFI_ERROR (Status);\r
+ Status = gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProtocolGuid,\r
+ EFI_NATIVE_INTERFACE, &mFdtClientProtocol);\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
}\r
\r
- return gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProtocolGuid,\r
- EFI_NATIVE_INTERFACE, &mFdtClientProtocol);\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
}\r