summaryrefslogtreecommitdiff
path: root/OvmfPkg/PlatformPei/Xen.c
diff options
context:
space:
mode:
Diffstat (limited to 'OvmfPkg/PlatformPei/Xen.c')
-rw-r--r--OvmfPkg/PlatformPei/Xen.c42
1 files changed, 30 insertions, 12 deletions
diff --git a/OvmfPkg/PlatformPei/Xen.c b/OvmfPkg/PlatformPei/Xen.c
index a720b91b9..8e5d79e8b 100644
--- a/OvmfPkg/PlatformPei/Xen.c
+++ b/OvmfPkg/PlatformPei/Xen.c
@@ -1,7 +1,7 @@
/**@file
Xen Platform PEI support
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2011, Andrei Warkentin <andreiw@motorola.com>
This program and the accompanying materials
@@ -29,9 +29,37 @@
#include <Guid/XenInfo.h>
#include "Platform.h"
+#include "Xen.h"
EFI_XEN_INFO mXenInfo;
+/**
+ Returns E820 map provided by Xen
+
+ @param Entries Pointer to E820 map
+ @param Count Number of entries
+
+ @return EFI_STATUS
+**/
+EFI_STATUS
+XenGetE820Map (
+ EFI_E820_ENTRY64 **Entries,
+ UINT32 *Count
+ )
+{
+ EFI_XEN_OVMF_INFO *Info =
+ (EFI_XEN_OVMF_INFO *)(UINTN) OVMF_INFO_PHYSICAL_ADDRESS;
+
+ if (AsciiStrCmp ((CHAR8 *) Info->Signature, "XenHVMOVMF")) {
+ return EFI_NOT_FOUND;
+ }
+
+ ASSERT (Info->E820 < MAX_ADDRESS);
+ *Entries = (EFI_E820_ENTRY64 *)(UINTN) Info->E820;
+ *Count = Info->E820EntriesCount;
+
+ return EFI_SUCCESS;
+}
/**
Connects to the Hypervisor.
@@ -119,19 +147,9 @@ XenDetect (
**/
EFI_STATUS
InitializeXen (
- VOID
+ UINT32 XenLeaf
)
{
- UINT32 XenLeaf;
-
- XenLeaf = XenDetect ();
-
- if (XenLeaf == 0) {
- return EFI_NOT_FOUND;
- }
-
- DEBUG ((EFI_D_INFO, "Xen was detected\n"));
-
XenConnect (XenLeaf);
//