WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
**/\r
\r
-#include <Protocol/PciEnumerationComplete.h>\r
+#include <Guid/RootBridgesConnectedEventGroup.h>\r
#include "AcpiPlatform.h"\r
\r
STATIC\r
STATIC\r
VOID\r
EFIAPI\r
-OnPciEnumerated (\r
+OnRootBridgesConnected (\r
IN EFI_EVENT Event,\r
IN VOID *Context\r
)\r
{\r
EFI_STATUS Status;\r
\r
- DEBUG ((EFI_D_INFO, "%a: PCI enumeration complete, installing ACPI tables\n",\r
+ DEBUG ((EFI_D_INFO,\r
+ "%a: root bridges have been connected, installing ACPI tables\n",\r
__FUNCTION__));\r
Status = InstallAcpiTables (FindAcpiTableProtocol ());\r
if (EFI_ERROR (Status)) {\r
)\r
{\r
EFI_STATUS Status;\r
- VOID *Interface;\r
- EFI_EVENT PciEnumerated;\r
- VOID *Registration;\r
+ EFI_EVENT RootBridgesConnected;\r
\r
//\r
// If the platform doesn't support PCI, or PCI enumeration has been disabled,\r
}\r
\r
//\r
- // Similarly, if PCI enumeration has already completed, install the tables\r
- // immediately.\r
+ // Otherwise, delay installing the ACPI tables until root bridges are\r
+ // connected. The entry point's return status will only reflect the callback\r
+ // setup. (Note that we're a DXE_DRIVER; our entry point function is invoked\r
+ // strictly before BDS is entered and can connect the root bridges.)\r
//\r
- Status = gBS->LocateProtocol (&gEfiPciEnumerationCompleteProtocolGuid,\r
- NULL /* Registration */, &Interface);\r
+ Status = gBS->CreateEventEx (EVT_NOTIFY_SIGNAL, TPL_CALLBACK,\r
+ OnRootBridgesConnected, NULL /* Context */,\r
+ &gRootBridgesConnectedEventGroupGuid, &RootBridgesConnected);\r
if (!EFI_ERROR (Status)) {\r
- DEBUG ((EFI_D_INFO, "%a: PCI enumeration already complete, "\r
- "installing ACPI tables\n", __FUNCTION__));\r
- return InstallAcpiTables (FindAcpiTableProtocol ());\r
- }\r
- ASSERT (Status == EFI_NOT_FOUND);\r
-\r
- //\r
- // Otherwise, delay installing the ACPI tables until PCI enumeration\r
- // completes. The entry point's return status will only reflect the callback\r
- // setup.\r
- //\r
- Status = gBS->CreateEvent (EVT_NOTIFY_SIGNAL, TPL_CALLBACK, OnPciEnumerated,\r
- NULL /* Context */, &PciEnumerated);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- Status = gBS->RegisterProtocolNotify (\r
- &gEfiPciEnumerationCompleteProtocolGuid, PciEnumerated,\r
- &Registration);\r
- if (EFI_ERROR (Status)) {\r
- gBS->CloseEvent (PciEnumerated);\r
- } else {\r
- DEBUG ((EFI_D_INFO, "%a: PCI enumeration pending, registered callback\n",\r
+ DEBUG ((EFI_D_INFO,\r
+ "%a: waiting for root bridges to be connected, registered callback\n",\r
__FUNCTION__));\r
}\r
\r