2 Entry point of OVMF ACPI Platform Driver
4 Copyright (C) 2015, Red Hat, Inc.
5 Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Guid/RootBridgesConnectedEventGroup.h>
11 #include "AcpiPlatform.h"
14 EFI_ACPI_TABLE_PROTOCOL
*
15 FindAcpiTableProtocol (
20 EFI_ACPI_TABLE_PROTOCOL
*AcpiTable
;
22 Status
= gBS
->LocateProtocol (
23 &gEfiAcpiTableProtocolGuid
,
27 ASSERT_EFI_ERROR (Status
);
35 OnRootBridgesConnected (
43 "%a: root bridges have been connected, installing ACPI tables\n",
45 Status
= InstallAcpiTables (FindAcpiTableProtocol ());
46 if (EFI_ERROR (Status
)) {
47 DEBUG ((EFI_D_ERROR
, "%a: InstallAcpiTables: %r\n", __FUNCTION__
, Status
));
49 gBS
->CloseEvent (Event
);
55 AcpiPlatformEntryPoint (
56 IN EFI_HANDLE ImageHandle
,
57 IN EFI_SYSTEM_TABLE
*SystemTable
61 EFI_EVENT RootBridgesConnected
;
64 // If the platform doesn't support PCI, or PCI enumeration has been disabled,
65 // install the tables at once, and let the entry point's return code reflect
66 // the full functionality.
68 if (PcdGetBool (PcdPciDisableBusEnumeration
)) {
69 DEBUG ((EFI_D_INFO
, "%a: PCI or its enumeration disabled, installing "
70 "ACPI tables\n", __FUNCTION__
));
71 return InstallAcpiTables (FindAcpiTableProtocol ());
75 // Otherwise, delay installing the ACPI tables until root bridges are
76 // connected. The entry point's return status will only reflect the callback
77 // setup. (Note that we're a DXE_DRIVER; our entry point function is invoked
78 // strictly before BDS is entered and can connect the root bridges.)
80 Status
= gBS
->CreateEventEx (EVT_NOTIFY_SIGNAL
, TPL_CALLBACK
,
81 OnRootBridgesConnected
, NULL
/* Context */,
82 &gRootBridgesConnectedEventGroupGuid
, &RootBridgesConnected
);
83 if (!EFI_ERROR (Status
)) {
85 "%a: waiting for root bridges to be connected, registered callback\n",