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 <[email protected]>
---
OvmfPkg/PlatformPei/Platform.c | 8 ++++++++
OvmfPkg/PlatformPei/Platform.h | 2 ++
OvmfPkg/PlatformPei/PlatformPei.inf | 1 +
3 files changed, 11 insertions(+)
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index 3e69d92..00c688d 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 9ed712f..31640e9 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 7c646ab..ad62035 100644
--- a/OvmfPkg/PlatformPei/PlatformPei.inf
+++ b/OvmfPkg/PlatformPei/PlatformPei.inf
@@ -54,6 +54,7 @@
PeiServicesLib
PeiServicesTablePointerLib
PeimEntryPoint
+ QemuFwCfgLib
MtrrLib
PcdLib
--
1.9.rc1
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel