VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/OvmfPkg/XenIoPvhDxe/XenIoPvhDxe.c@ 99404

Last change on this file since 99404 was 99404, checked in by vboxsync, 20 months ago

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

  • Property svn:eol-style set to native
File size: 1.0 KB
Line 
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}
Note: See TracBrowser for help on using the repository browser.

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