summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/PlatformPei/Xen.c
diff options
context:
space:
mode:
authorWei Liu <wei.liu2@citrix.com>2013-12-08 01:36:15 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2013-12-08 01:36:15 +0000
commitbb6a9a9305de5463968a09bb4c5f99f388548a35 (patch)
tree56c9263548111c5d0c03d31856e5159eea962e6c /OvmfPkg/PlatformPei/Xen.c
parent36658fff454167c716993cf649f6172361b0e7b2 (diff)
downloadedk2-bb6a9a9305de5463968a09bb4c5f99f388548a35.tar.gz
edk2-bb6a9a9305de5463968a09bb4c5f99f388548a35.tar.bz2
edk2-bb6a9a9305de5463968a09bb4c5f99f388548a35.zip
OvmfPkg: introduce XenMemMapInitialization
This function parses E820 map provided by Xen and arrange memory maps accordingly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wei Liu <wei.liu2@citrix.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> [jordan.l.justen@intel.com: XenGetE820Map: VS2010 compat; add assert] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14945 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/PlatformPei/Xen.c')
-rw-r--r--OvmfPkg/PlatformPei/Xen.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/OvmfPkg/PlatformPei/Xen.c b/OvmfPkg/PlatformPei/Xen.c
index 054cc4a16b..8e5d79e8b8 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.