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> // gRootBridgesConnectedEve...
11 #include <Library/DebugLib.h> // DEBUG()
12 #include <Library/PcdLib.h> // PcdGetBool()
13 #include <Library/UefiBootServicesTableLib.h> // gBS
14 #include <Protocol/AcpiTable.h> // EFI_ACPI_TABLE_PROTOCOL
16 #include "AcpiPlatform.h"
19 EFI_ACPI_TABLE_PROTOCOL
*
20 FindAcpiTableProtocol (
25 EFI_ACPI_TABLE_PROTOCOL
*AcpiTable
;
27 Status
= gBS
->LocateProtocol (
28 &gEfiAcpiTableProtocolGuid
,
32 ASSERT_EFI_ERROR (Status
);
39 OnRootBridgesConnected (
48 "%a: root bridges have been connected, installing ACPI tables\n",
51 Status
= InstallAcpiTables (FindAcpiTableProtocol ());
52 if (EFI_ERROR (Status
)) {
53 DEBUG ((DEBUG_ERROR
, "%a: InstallAcpiTables: %r\n", __FUNCTION__
, Status
));
56 gBS
->CloseEvent (Event
);
61 AcpiPlatformEntryPoint (
62 IN EFI_HANDLE ImageHandle
,
63 IN EFI_SYSTEM_TABLE
*SystemTable
67 EFI_EVENT RootBridgesConnected
;
70 // If the platform doesn't support PCI, or PCI enumeration has been disabled,
71 // install the tables at once, and let the entry point's return code reflect
72 // the full functionality.
74 if (PcdGetBool (PcdPciDisableBusEnumeration
)) {
77 "%a: PCI or its enumeration disabled, installing "
81 return InstallAcpiTables (FindAcpiTableProtocol ());
85 // Otherwise, delay installing the ACPI tables until root bridges are
86 // connected. The entry point's return status will only reflect the callback
87 // setup. (Note that we're a DXE_DRIVER; our entry point function is invoked
88 // strictly before BDS is entered and can connect the root bridges.)
90 Status
= gBS
->CreateEventEx (
93 OnRootBridgesConnected
,
95 &gRootBridgesConnectedEventGroupGuid
,
98 if (!EFI_ERROR (Status
)) {
101 "%a: waiting for root bridges to be connected, registered callback\n",