Last change
on this file since 94368 was 80721, checked in by vboxsync, 5 years ago |
Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), 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 |
|
---|
18 | EFI_STATUS
|
---|
19 | EFIAPI
|
---|
20 | InitializeXenIoPvhDxe (
|
---|
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 |
|
---|
49 | Error:
|
---|
50 | if (Allocation != NULL) {
|
---|
51 | FreePages (Allocation, FixedPcdGet32 (PcdXenGrantFrames));
|
---|
52 | }
|
---|
53 | return Status;
|
---|
54 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.