3 The KvmtoolPlatformDxe performs the platform specific initialization like:
4 - It decides if the firmware should expose ACPI or Device Tree-based
5 hardware description to the operating system.
7 Copyright (c) 2018 - 2020, ARM Limited. All rights reserved.
9 SPDX-License-Identifier: BSD-2-Clause-Patent
13 #include <Guid/VariableFormat.h>
14 #include <Library/BaseLib.h>
15 #include <Library/DebugLib.h>
16 #include <Library/UefiBootServicesTableLib.h>
17 #include <Protocol/FdtClient.h>
19 /** Decide if the firmware should expose ACPI tables or Device Tree and
20 install the appropriate protocol interface.
22 Note: This function is derived from "ArmVirtPkg/PlatformHasAcpiDtDxe",
23 by dropping the word size check, and the fw_cfg check.
25 @param [in] ImageHandle Handle for this image.
27 @retval EFI_SUCCESS Success.
28 @retval EFI_OUT_OF_RESOURCES There was not enough memory to install the
30 @retval EFI_INVALID_PARAMETER A parameter is invalid.
36 IN EFI_HANDLE ImageHandle
39 if (!PcdGetBool (PcdForceNoAcpi
)) {
41 return gBS
->InstallProtocolInterface (
43 &gEdkiiPlatformHasAcpiGuid
,
49 // Expose the Device Tree.
50 return gBS
->InstallProtocolInterface (
52 &gEdkiiPlatformHasDeviceTreeGuid
,
58 /** Entry point for Kvmtool Platform Dxe
60 @param [in] ImageHandle Handle for this image.
61 @param [in] SystemTable Pointer to the EFI system table.
63 @retval EFI_SUCCESS Success.
64 @retval EFI_OUT_OF_RESOURCES There was not enough memory to install the
66 @retval EFI_INVALID_PARAMETER A parameter is invalid.
71 KvmtoolPlatformDxeEntryPoint (
72 IN EFI_HANDLE ImageHandle
,
73 IN EFI_SYSTEM_TABLE
*SystemTable
78 Status
= PlatformHasAcpiDt (ImageHandle
);
79 ASSERT_EFI_ERROR (Status
);