OvmfPkg/PlatformPei: Detect S3 support for QEMU / KVM
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 4 Mar 2014 08:01:58 +0000 (08:01 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 4 Mar 2014 08:01:58 +0000 (08:01 +0000)
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

OvmfPkg/PlatformPei/Platform.c
OvmfPkg/PlatformPei/Platform.h
OvmfPkg/PlatformPei/PlatformPei.inf

index 3e69d92..00c688d 100644 (file)
@@ -30,6 +30,7 @@
 #include <Library/PciLib.h>\r
 #include <Library/PeimEntryPoint.h>\r
 #include <Library/PeiServicesLib.h>\r
+#include <Library/QemuFwCfgLib.h>\r
 #include <Library/ResourcePublicationLib.h>\r
 #include <Guid/MemoryTypeInformation.h>\r
 #include <Ppi/MasterBootMode.h>\r
@@ -61,6 +62,8 @@ EFI_PEI_PPI_DESCRIPTOR   mPpiBootMode[] = {
 \r
 EFI_BOOT_MODE mBootMode = BOOT_WITH_FULL_CONFIGURATION;\r
 \r
+BOOLEAN mS3Supported = FALSE;\r
+\r
 \r
 VOID\r
 AddIoMemoryBaseSizeHob (\r
@@ -356,6 +359,11 @@ InitializePlatform (
 \r
   XenDetect ();\r
 \r
+  if (QemuFwCfgS3Enabled ()) {\r
+    DEBUG ((EFI_D_INFO, "S3 support was detected on QEMU\n"));\r
+    mS3Supported = TRUE;\r
+  }\r
+\r
   BootModeInitialization ();\r
 \r
   PublishPeiMemory ();\r
index 9ed712f..31640e9 100644 (file)
@@ -98,4 +98,6 @@ XenPublishRamRegions (
 \r
 extern EFI_BOOT_MODE mBootMode;\r
 \r
+extern BOOLEAN mS3Supported;\r
+\r
 #endif // _PLATFORM_PEI_H_INCLUDED_\r
index 7c646ab..ad62035 100644 (file)
@@ -54,6 +54,7 @@
   PeiServicesLib\r
   PeiServicesTablePointerLib\r
   PeimEntryPoint\r
+  QemuFwCfgLib\r
   MtrrLib\r
   PcdLib\r
 \r