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 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/PlatformHasAcpi.h>
17 #include <Guid/PlatformHasDeviceTree.h>
18 #include <Library/BaseLib.h>
19 #include <Library/DebugLib.h>
20 #include <Library/UefiBootServicesTableLib.h>
24 XenPlatformHasAcpiDt (
25 IN EFI_HANDLE ImageHandle
,
26 IN EFI_SYSTEM_TABLE
*SystemTable
32 // If we fail to install any of the necessary protocols below, the OS will be
33 // unbootable anyway (due to lacking hardware description), so tolerate no
36 // Always make ACPI available on 64-bit systems.
38 if (MAX_UINTN
== MAX_UINT64
) {
39 Status
= gBS
->InstallProtocolInterface (
41 &gEdkiiPlatformHasAcpiGuid
,
45 if (EFI_ERROR (Status
)) {
51 // Expose the Device Tree unconditionally.
53 Status
= gBS
->InstallProtocolInterface (
55 &gEdkiiPlatformHasDeviceTreeGuid
,
59 if (EFI_ERROR (Status
)) {
66 ASSERT_EFI_ERROR (Status
);
69 // Keep compilers happy.