summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2014-03-04 08:01:58 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2014-03-04 08:01:58 +0000
commit7cdba6346b97562dad9809297cd7a32979a5a1d8 (patch)
tree32cc2dfb9a36acdbe46cdda5925c726a76ffcea5
parent14eb7a5be2d6415ca614fb62c28fd165eed3c572 (diff)
downloadedk2-platforms-7cdba6346b97562dad9809297cd7a32979a5a1d8.tar.xz
OvmfPkg/PlatformPei: Detect S3 support for QEMU / KVM
QEMU indicates whether S3 is supported or not in the fw-cfg interface. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15293 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--OvmfPkg/PlatformPei/Platform.c8
-rw-r--r--OvmfPkg/PlatformPei/Platform.h2
-rw-r--r--OvmfPkg/PlatformPei/PlatformPei.inf1
3 files changed, 11 insertions, 0 deletions
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index 3e69d923d4..00c688d68a 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -30,6 +30,7 @@
#include <Library/PciLib.h>
#include <Library/PeimEntryPoint.h>
#include <Library/PeiServicesLib.h>
+#include <Library/QemuFwCfgLib.h>
#include <Library/ResourcePublicationLib.h>
#include <Guid/MemoryTypeInformation.h>
#include <Ppi/MasterBootMode.h>
@@ -61,6 +62,8 @@ EFI_PEI_PPI_DESCRIPTOR mPpiBootMode[] = {
EFI_BOOT_MODE mBootMode = BOOT_WITH_FULL_CONFIGURATION;
+BOOLEAN mS3Supported = FALSE;
+
VOID
AddIoMemoryBaseSizeHob (
@@ -356,6 +359,11 @@ InitializePlatform (
XenDetect ();
+ if (QemuFwCfgS3Enabled ()) {
+ DEBUG ((EFI_D_INFO, "S3 support was detected on QEMU\n"));
+ mS3Supported = TRUE;
+ }
+
BootModeInitialization ();
PublishPeiMemory ();
diff --git a/OvmfPkg/PlatformPei/Platform.h b/OvmfPkg/PlatformPei/Platform.h
index 9ed712f3cd..31640e9b30 100644
--- a/OvmfPkg/PlatformPei/Platform.h
+++ b/OvmfPkg/PlatformPei/Platform.h
@@ -98,4 +98,6 @@ XenPublishRamRegions (
extern EFI_BOOT_MODE mBootMode;
+extern BOOLEAN mS3Supported;
+
#endif // _PLATFORM_PEI_H_INCLUDED_
diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/PlatformPei.inf
index 7c646ab8a0..ad620350a2 100644
--- a/OvmfPkg/PlatformPei/PlatformPei.inf
+++ b/OvmfPkg/PlatformPei/PlatformPei.inf
@@ -54,6 +54,7 @@
PeiServicesLib
PeiServicesTablePointerLib
PeimEntryPoint
+ QemuFwCfgLib
MtrrLib
PcdLib