VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.c

最後變更 在這個檔案是 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
檔案大小: 1.5 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) 2017, Red Hat, Inc.
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/UefiBootServicesTableLib.h>
15
16EFI_STATUS
17EFIAPI
18XenPlatformHasAcpiDt (
19 IN EFI_HANDLE ImageHandle,
20 IN EFI_SYSTEM_TABLE *SystemTable
21 )
22{
23 EFI_STATUS Status;
24
25 //
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
28 // errors here.
29 //
30 // Always make ACPI available on 64-bit systems.
31 //
32 if (MAX_UINTN == MAX_UINT64) {
33 Status = gBS->InstallProtocolInterface (
34 &ImageHandle,
35 &gEdkiiPlatformHasAcpiGuid,
36 EFI_NATIVE_INTERFACE,
37 NULL
38 );
39 if (EFI_ERROR (Status)) {
40 goto Failed;
41 }
42 }
43
44 //
45 // Expose the Device Tree unconditionally.
46 //
47 Status = gBS->InstallProtocolInterface (
48 &ImageHandle,
49 &gEdkiiPlatformHasDeviceTreeGuid,
50 EFI_NATIVE_INTERFACE,
51 NULL
52 );
53 if (EFI_ERROR (Status)) {
54 goto Failed;
55 }
56
57 return Status;
58
59Failed:
60 ASSERT_EFI_ERROR (Status);
61 CpuDeadLoop ();
62 //
63 // Keep compilers happy.
64 //
65 return Status;
66}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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