]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/QemuFwCfgS3Lib: add initial Base Null library instance
authorLaszlo Ersek <lersek@redhat.com>
Wed, 22 Feb 2017 01:09:47 +0000 (02:09 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 14 Mar 2017 20:49:09 +0000 (21:49 +0100)
This library instance returns constant FALSE from QemuFwCfgS3Enabled(),
and all other library functions trigger assertion failures. It is suitable
for QEMU targets and machine types that never enable S3.

The QemuFwCfgS3Enabled() implementation is copied from
"ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c". Stubs for further
QemuFwCfgS3Lib APIs (with assertion failures, see above) will be added
later.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=394
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/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf [new file with mode: 0644]
OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3Base.c [new file with mode: 0644]

diff --git a/OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf b/OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
new file mode 100644 (file)
index 0000000..ba24a0b
--- /dev/null
@@ -0,0 +1,39 @@
+## @file\r
+# Base Null library instance of the QemuFwCfgS3Lib class.\r
+#\r
+# This library instance returns constant FALSE from QemuFwCfgS3Enabled(), and\r
+# all other library functions trigger assertion failures. It is suitable for\r
+# QEMU targets and machine types that never enable S3.\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
+[Defines]\r
+  INF_VERSION                    = 1.25\r
+  BASE_NAME                      = BaseQemuFwCfgS3LibNull\r
+  FILE_GUID                      = EA7D2B69-D221-4950-9C2C-C38A65BCC96E\r
+  MODULE_TYPE                    = BASE\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = QemuFwCfgS3Lib\r
+\r
+#\r
+# The following information is for reference only and not required by the build\r
+# tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 ARM AARCH64 IPF EBC\r
+#\r
+\r
+[Sources]\r
+  QemuFwCfgS3Base.c\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  OvmfPkg/OvmfPkg.dec\r
diff --git a/OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3Base.c b/OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3Base.c
new file mode 100644 (file)
index 0000000..bed9bf3
--- /dev/null
@@ -0,0 +1,39 @@
+/** @file\r
+  Base Null library instance of the QemuFwCfgS3Lib class.\r
+\r
+  This library instance returns constant FALSE from QemuFwCfgS3Enabled(), and\r
+  all other library functions trigger assertion failures. It is suitable for\r
+  QEMU targets and machine types that never enable S3.\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
+#include <Library/QemuFwCfgS3Lib.h>\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
+  return FALSE;\r
+}\r