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 This program and the accompanying materials are licensed and made available
8 under the terms and conditions of the BSD License which accompanies this
9 distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
13 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include <Guid/RootBridgesConnectedEventGroup.h>
17 #include "AcpiPlatform.h"
20 EFI_ACPI_TABLE_PROTOCOL
*
21 FindAcpiTableProtocol (
26 EFI_ACPI_TABLE_PROTOCOL
*AcpiTable
;
28 Status
= gBS
->LocateProtocol (
29 &gEfiAcpiTableProtocolGuid
,
33 ASSERT_EFI_ERROR (Status
);
41 OnRootBridgesConnected (
49 "%a: root bridges have been connected, installing ACPI tables\n",
51 Status
= InstallAcpiTables (FindAcpiTableProtocol ());
52 if (EFI_ERROR (Status
)) {
53 DEBUG ((EFI_D_ERROR
, "%a: InstallAcpiTables: %r\n", __FUNCTION__
, Status
));
55 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
)) {
75 DEBUG ((EFI_D_INFO
, "%a: PCI or its enumeration disabled, installing "
76 "ACPI tables\n", __FUNCTION__
));
77 return InstallAcpiTables (FindAcpiTableProtocol ());
81 // Otherwise, delay installing the ACPI tables until root bridges are
82 // connected. The entry point's return status will only reflect the callback
83 // setup. (Note that we're a DXE_DRIVER; our entry point function is invoked
84 // strictly before BDS is entered and can connect the root bridges.)
86 Status
= gBS
->CreateEventEx (EVT_NOTIFY_SIGNAL
, TPL_CALLBACK
,
87 OnRootBridgesConnected
, NULL
/* Context */,
88 &gRootBridgesConnectedEventGroupGuid
, &RootBridgesConnected
);
89 if (!EFI_ERROR (Status
)) {
91 "%a: waiting for root bridges to be connected, registered callback\n",