3 Driver for the XenIo protocol
5 This driver simply allocate space for the grant tables.
7 Copyright (c) 2019, Citrix Systems, Inc.
9 SPDX-License-Identifier: BSD-2-Clause-Patent
13 #include <Library/MemoryAllocationLib.h>
14 #include <Library/PcdLib.h>
15 #include <Library/XenIoMmioLib.h>
16 #include <Library/XenPlatformLib.h>
20 InitializeXenIoPvhDxe (
21 IN EFI_HANDLE ImageHandle
,
22 IN EFI_SYSTEM_TABLE
*SystemTable
27 EFI_HANDLE XenIoHandle
;
32 if (!XenPvhDetected ()) {
33 return EFI_UNSUPPORTED
;
36 Allocation
= AllocateReservedPages (FixedPcdGet32 (PcdXenGrantFrames
));
37 if (Allocation
== NULL
) {
38 Status
= EFI_OUT_OF_RESOURCES
;
42 Status
= XenIoMmioInstall (&XenIoHandle
, (UINTN
) Allocation
);
43 if (EFI_ERROR (Status
)) {
50 if (Allocation
!= NULL
) {
51 FreePages (Allocation
, FixedPcdGet32 (PcdXenGrantFrames
));