]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/AcpiPlatformDxe/BootScript.c
BaseTools: Sort file list in Makefile
[mirror_edk2.git] / OvmfPkg / AcpiPlatformDxe / BootScript.c
index a7d2f9e38f5742f2b9894b5234a5705d39e56a30..7137994471bd91f634949b2ab49b0637c1907512 100644 (file)
@@ -4,13 +4,7 @@
 \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
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 **/\r
 \r
 #include <Library/MemoryAllocationLib.h>\r
@@ -249,7 +243,10 @@ FatalError:
                         because the ownership of S3Context has been transfered.\r
 \r
   @retval EFI_SUCCESS The translation of S3Context to ACPI S3 Boot Script\r
-                      opcodes has been successfully executed or queued.\r
+                      opcodes has been successfully executed or queued. (This\r
+                      includes the case when S3Context was empty on input and\r
+                      no ACPI S3 Boot Script opcodes have been necessary to\r
+                      produce.)\r
 \r
   @return             Error codes from underlying functions.\r
 **/\r
@@ -260,6 +257,11 @@ TransferS3ContextToBootScript (
 {\r
   RETURN_STATUS Status;\r
 \r
+  if (S3Context->Used == 0) {\r
+    ReleaseS3Context (S3Context);\r
+    return EFI_SUCCESS;\r
+  }\r
+\r
   Status = QemuFwCfgS3CallWhenBootScriptReady (AppendFwCfgBootScript,\r
              S3Context, sizeof (SCRATCH_BUFFER));\r
   return (EFI_STATUS)Status;\r