VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/AcpiPlatformDxe/EntryPoint.c@ 94368

Last change on this file since 94368 was 85718, checked in by vboxsync, 4 years ago

Devices/EFI: Merge edk-stable202005 and make it build, bugref:4643

  • Property svn:eol-style set to native
File size: 2.3 KB
Line 
1/** @file
2 Entry point of OVMF ACPI Platform Driver
3
4 Copyright (C) 2015, Red Hat, Inc.
5 Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8**/
9
10#include <Guid/RootBridgesConnectedEventGroup.h>
11#include "AcpiPlatform.h"
12
13STATIC
14EFI_ACPI_TABLE_PROTOCOL *
15FindAcpiTableProtocol (
16 VOID
17 )
18{
19 EFI_STATUS Status;
20 EFI_ACPI_TABLE_PROTOCOL *AcpiTable;
21
22 Status = gBS->LocateProtocol (
23 &gEfiAcpiTableProtocolGuid,
24 NULL,
25 (VOID**)&AcpiTable
26 );
27 ASSERT_EFI_ERROR (Status);
28 return AcpiTable;
29}
30
31
32STATIC
33VOID
34EFIAPI
35OnRootBridgesConnected (
36 IN EFI_EVENT Event,
37 IN VOID *Context
38 )
39{
40 EFI_STATUS Status;
41
42 DEBUG ((DEBUG_INFO,
43 "%a: root bridges have been connected, installing ACPI tables\n",
44 __FUNCTION__));
45 Status = InstallAcpiTables (FindAcpiTableProtocol ());
46 if (EFI_ERROR (Status)) {
47 DEBUG ((DEBUG_ERROR, "%a: InstallAcpiTables: %r\n", __FUNCTION__, Status));
48 }
49 gBS->CloseEvent (Event);
50}
51
52
53EFI_STATUS
54EFIAPI
55AcpiPlatformEntryPoint (
56 IN EFI_HANDLE ImageHandle,
57 IN EFI_SYSTEM_TABLE *SystemTable
58 )
59{
60 EFI_STATUS Status;
61 EFI_EVENT RootBridgesConnected;
62
63 //
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.
67 //
68 if (PcdGetBool (PcdPciDisableBusEnumeration)) {
69 DEBUG ((DEBUG_INFO, "%a: PCI or its enumeration disabled, installing "
70 "ACPI tables\n", __FUNCTION__));
71 return InstallAcpiTables (FindAcpiTableProtocol ());
72 }
73
74 //
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.)
79 //
80 Status = gBS->CreateEventEx (EVT_NOTIFY_SIGNAL, TPL_CALLBACK,
81 OnRootBridgesConnected, NULL /* Context */,
82 &gRootBridgesConnectedEventGroupGuid, &RootBridgesConnected);
83 if (!EFI_ERROR (Status)) {
84 DEBUG ((DEBUG_INFO,
85 "%a: waiting for root bridges to be connected, registered callback\n",
86 __FUNCTION__));
87 }
88
89 return Status;
90}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette