summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Liu <wei.liu2@citrix.com>2013-12-08 01:36:00 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2013-12-08 01:36:00 +0000
commitc7ea55b92b56a7434cb6f5c33fffc76eb1086e08 (patch)
treeae28a5ac47b1dd5587ebc45c4f4727d27ef16f29
parent4c3966e9ff1cf93b19f069127806da5dc64b82fd (diff)
downloadedk2-c7ea55b92b56a7434cb6f5c33fffc76eb1086e08.zip
edk2-c7ea55b92b56a7434cb6f5c33fffc76eb1086e08.tar.gz
edk2-c7ea55b92b56a7434cb6f5c33fffc76eb1086e08.tar.bz2
OvmfPkg: detect Xen earlier
This is useful for initializing memory map. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14943 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--OvmfPkg/PlatformPei/Platform.c8
-rw-r--r--OvmfPkg/PlatformPei/Platform.h5
-rw-r--r--OvmfPkg/PlatformPei/Xen.c12
3 files changed, 13 insertions, 12 deletions
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index fb56e99..9b7828f 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -338,14 +338,20 @@ InitializePlatform (
)
{
EFI_PHYSICAL_ADDRESS TopOfMemory;
+ UINT32 XenLeaf;
DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n"));
DebugDumpCmos ();
+ XenLeaf = XenDetect ();
+
TopOfMemory = MemDetect ();
- InitializeXen ();
+ if (XenLeaf != 0) {
+ DEBUG ((EFI_D_INFO, "Xen was detected\n"));
+ InitializeXen (XenLeaf);
+ }
ReserveEmuVariableNvStore ();
diff --git a/OvmfPkg/PlatformPei/Platform.h b/OvmfPkg/PlatformPei/Platform.h
index 383e6a4..d63d124 100644
--- a/OvmfPkg/PlatformPei/Platform.h
+++ b/OvmfPkg/PlatformPei/Platform.h
@@ -69,6 +69,11 @@ PeiFvInitialization (
EFI_STATUS
InitializeXen (
+ UINT32 XenLeaf
+ );
+
+UINT32
+XenDetect (
VOID
);
diff --git a/OvmfPkg/PlatformPei/Xen.c b/OvmfPkg/PlatformPei/Xen.c
index a720b91..054cc4a 100644
--- a/OvmfPkg/PlatformPei/Xen.c
+++ b/OvmfPkg/PlatformPei/Xen.c
@@ -119,19 +119,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);
//