VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/XenIoPvhDxe/XenIoPvhDxe.c

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

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.0 KB
 
1/** @file
2
3 Driver for the XenIo protocol
4
5 This driver simply allocate space for the grant tables.
6
7 Copyright (c) 2019, Citrix Systems, Inc.
8
9 SPDX-License-Identifier: BSD-2-Clause-Patent
10
11**/
12
13#include <Library/MemoryAllocationLib.h>
14#include <Library/PcdLib.h>
15#include <Library/XenIoMmioLib.h>
16#include <Library/XenPlatformLib.h>
17
18EFI_STATUS
19EFIAPI
20InitializeXenIoPvhDxe (
21 IN EFI_HANDLE ImageHandle,
22 IN EFI_SYSTEM_TABLE *SystemTable
23 )
24{
25 VOID *Allocation;
26 EFI_STATUS Status;
27 EFI_HANDLE XenIoHandle;
28
29 Allocation = NULL;
30 XenIoHandle = NULL;
31
32 if (!XenPvhDetected ()) {
33 return EFI_UNSUPPORTED;
34 }
35
36 Allocation = AllocateReservedPages (FixedPcdGet32 (PcdXenGrantFrames));
37 if (Allocation == NULL) {
38 Status = EFI_OUT_OF_RESOURCES;
39 goto Error;
40 }
41
42 Status = XenIoMmioInstall (&XenIoHandle, (UINTN)Allocation);
43 if (EFI_ERROR (Status)) {
44 goto Error;
45 }
46
47 return EFI_SUCCESS;
48
49Error:
50 if (Allocation != NULL) {
51 FreePages (Allocation, FixedPcdGet32 (PcdXenGrantFrames));
52 }
53
54 return Status;
55}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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