VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/ArmVirtPkg/CloudHvPlatformHasAcpiDtDxe/CloudHvHasAcpiDtDxe.c@ 99476

最後變更 在這個檔案從99476是 99464,由 vboxsync 提交於 2 年 前

Devices/EFI/Firmware: Restore ArmPkg, ArmVirtPkg, ArmPlatformPkg in order to be able to build Aarch64 and Aarch32 firmware images for the virt platform, bugref:10400

  • 屬性 svn:eol-style 設為 native
檔案大小: 2.0 KB
 
1/** @file
2 Decide whether the firmware should expose an ACPI- and/or a Device Tree-based
3 hardware description to the operating system.
4
5 Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8**/
9
10#include <Guid/PlatformHasAcpi.h>
11#include <Guid/PlatformHasDeviceTree.h>
12#include <Library/BaseLib.h>
13#include <Library/DebugLib.h>
14#include <Library/PcdLib.h>
15#include <Library/UefiBootServicesTableLib.h>
16
17/** Entry point for the Cloud Hypervisor PlatformHasAcpiDtDxe.
18
19 @param [in] ImageHandle Handle for this image.
20 @param [in] SystemTable Pointer to the EFI system table.
21
22 @return EFI_SUCCESS If ACPI or Device Tree based hardware
23 description protocol was installed.
24 @return EFI_INVALID_PARAMETER A parameter was invalid.
25 @return EFI_OUT_OF_RESOURCES Insufficient resources exist to complete
26 the request.
27**/
28EFI_STATUS
29EFIAPI
30PlatformHasAcpiDt (
31 IN EFI_HANDLE ImageHandle,
32 IN EFI_SYSTEM_TABLE *SystemTable
33 )
34{
35 EFI_STATUS Status;
36
37 //
38 // If we fail to install any of the necessary protocols below, the OS will be
39 // unbootable anyway (due to lacking hardware description), so tolerate no
40 // errors here.
41 //
42 if ((MAX_UINTN == MAX_UINT64) &&
43 !PcdGetBool (PcdForceNoAcpi))
44 {
45 Status = gBS->InstallProtocolInterface (
46 &ImageHandle,
47 &gEdkiiPlatformHasAcpiGuid,
48 EFI_NATIVE_INTERFACE,
49 NULL
50 );
51 if (EFI_ERROR (Status)) {
52 goto Failed;
53 }
54
55 return Status;
56 }
57
58 //
59 // Expose the Device Tree otherwise.
60 //
61 Status = gBS->InstallProtocolInterface (
62 &ImageHandle,
63 &gEdkiiPlatformHasDeviceTreeGuid,
64 EFI_NATIVE_INTERFACE,
65 NULL
66 );
67 if (EFI_ERROR (Status)) {
68 goto Failed;
69 }
70
71 return Status;
72
73Failed:
74 ASSERT_EFI_ERROR (Status);
75 CpuDeadLoop ();
76 //
77 // Keep compilers happy.
78 //
79 return Status;
80}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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