]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: introduce QemuFwCfgS3Lib class
authorLaszlo Ersek <lersek@redhat.com>
Wed, 22 Feb 2017 00:59:41 +0000 (01:59 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 14 Mar 2017 20:49:01 +0000 (21:49 +0100)
This library class will enable driver modules (a) to query whether S3
support was enabled on the QEMU command line, (b) to produce fw_cfg DMA
operations that are to be replayed at S3 resume time.

Declare the library class in OvmfPkg/OvmfPkg.dec, and add the library
class header under OvmfPkg/Include/Library/. At the moment, the only API
we expose is QemuFwCfgS3Enabled(), which we'll first migrate from
QemuFwCfgLib. Further interfaces will be added in later patches.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=394
Suggested-by: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
OvmfPkg/Include/Library/QemuFwCfgS3Lib.h [new file with mode: 0644]
OvmfPkg/OvmfPkg.dec

diff --git a/OvmfPkg/Include/Library/QemuFwCfgS3Lib.h b/OvmfPkg/Include/Library/QemuFwCfgS3Lib.h
new file mode 100644 (file)
index 0000000..1c47361
--- /dev/null
@@ -0,0 +1,39 @@
+/** @file\r
+  S3 support for QEMU fw_cfg\r
+\r
+  This library class enables driver modules (a) to query whether S3 support was\r
+  enabled on the QEMU command line, (b) to produce fw_cfg DMA operations that\r
+  are to be replayed at S3 resume time.\r
+\r
+  Copyright (C) 2017, Red Hat, Inc.\r
+\r
+  This program and the accompanying materials are licensed and made available\r
+  under the terms and conditions of the BSD License which accompanies this\r
+  distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
+  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
+#ifndef __FW_CFG_S3_LIB__\r
+#define __FW_CFG_S3_LIB__\r
+\r
+/**\r
+  Determine if S3 support is explicitly enabled.\r
+\r
+  @retval  TRUE   If S3 support is explicitly enabled. Other functions in this\r
+                  library may be called (subject to their individual\r
+                  restrictions).\r
+\r
+           FALSE  Otherwise. This includes unavailability of the firmware\r
+                  configuration interface. No other function in this library\r
+                  must be called.\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+QemuFwCfgS3Enabled (\r
+  VOID\r
+  );\r
+\r
+#endif\r
index a0c76a5bb4481f740a8e30be1e7cdd716ebe465b..3490f7ca7c07347937f7122ec3f21adafe3224c6 100644 (file)
   #\r
   QemuFwCfgLib|Include/Library/QemuFwCfgLib.h\r
 \r
+  ##  @libraryclass  S3 support for QEMU fw_cfg\r
+  #\r
+  QemuFwCfgS3Lib|Include/Library/QemuFwCfgS3Lib.h\r
+\r
   ##  @libraryclass  Rewrite the BootOrder NvVar based on QEMU's "bootorder"\r
   #                  fw_cfg file.\r
   #\r