/**@file\r
Xen Platform PEI support\r
\r
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
Copyright (c) 2011, Andrei Warkentin <andreiw@motorola.com>\r
\r
This program and the accompanying materials\r
#include <Guid/XenInfo.h>\r
\r
#include "Platform.h"\r
+#include "Xen.h"\r
\r
EFI_XEN_INFO mXenInfo;\r
\r
+/**\r
+ Returns E820 map provided by Xen\r
+\r
+ @param Entries Pointer to E820 map\r
+ @param Count Number of entries\r
+\r
+ @return EFI_STATUS\r
+**/\r
+EFI_STATUS\r
+XenGetE820Map (\r
+ EFI_E820_ENTRY64 **Entries,\r
+ UINT32 *Count\r
+ )\r
+{\r
+ EFI_XEN_OVMF_INFO *Info =\r
+ (EFI_XEN_OVMF_INFO *)(UINTN) OVMF_INFO_PHYSICAL_ADDRESS;\r
+\r
+ if (AsciiStrCmp ((CHAR8 *) Info->Signature, "XenHVMOVMF")) {\r
+ return EFI_NOT_FOUND;\r
+ }\r
+\r
+ ASSERT (Info->E820 < MAX_ADDRESS);\r
+ *Entries = (EFI_E820_ENTRY64 *)(UINTN) Info->E820;\r
+ *Count = Info->E820EntriesCount;\r
+\r
+ return EFI_SUCCESS;\r
+}\r
\r
/**\r
Connects to the Hypervisor.\r