2 Decide whether the firmware should expose an ACPI- and/or a Device Tree-based
3 hardware description to the operating system.
5 Copyright (c) 2017, Red Hat, Inc.
7 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Guid/PlatformHasAcpi.h>
11 #include <Guid/PlatformHasDeviceTree.h>
12 #include <Library/BaseLib.h>
13 #include <Library/DebugLib.h>
14 #include <Library/UefiBootServicesTableLib.h>
18 XenPlatformHasAcpiDt (
19 IN EFI_HANDLE ImageHandle
,
20 IN EFI_SYSTEM_TABLE
*SystemTable
26 // If we fail to install any of the necessary protocols below, the OS will be
27 // unbootable anyway (due to lacking hardware description), so tolerate no
30 // Always make ACPI available on 64-bit systems.
32 if (MAX_UINTN
== MAX_UINT64
) {
33 Status
= gBS
->InstallProtocolInterface (
35 &gEdkiiPlatformHasAcpiGuid
,
39 if (EFI_ERROR (Status
)) {
45 // Expose the Device Tree unconditionally.
47 Status
= gBS
->InstallProtocolInterface (
49 &gEdkiiPlatformHasDeviceTreeGuid
,
53 if (EFI_ERROR (Status
)) {
60 ASSERT_EFI_ERROR (Status
);
63 // Keep compilers happy.