From nobody Sat Nov 2 16:35:42 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1487814516816853.704261914962; Wed, 22 Feb 2017 17:48:36 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 21F6A82268; Wed, 22 Feb 2017 17:48:32 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C48AC82250 for ; Wed, 22 Feb 2017 17:48:29 -0800 (PST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 610A33D95F; Thu, 23 Feb 2017 01:48:30 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-134.phx2.redhat.com [10.3.116.134]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1N1mJFK012836; Wed, 22 Feb 2017 20:48:29 -0500 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Thu, 23 Feb 2017 02:48:08 +0100 Message-Id: <20170223014814.10937-7-lersek@redhat.com> In-Reply-To: <20170223014814.10937-1-lersek@redhat.com> References: <20170223014814.10937-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 23 Feb 2017 01:48:30 +0000 (UTC) Subject: [edk2] [PATCH 06/12] ArmVirtPkg, OvmfPkg: retire QemuFwCfgS3Enabled() from QemuFwCfgLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen , Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" At this point we're ready to retire QemuFwCfgS3Enabled() from the QemuFwCfgLib class, together with its implementations in: - ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c - OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c Extend all modules that call the function with a new QemuFwCfgS3Lib class dependency. Thanks to the previously added library class, instances, and class resolutions, we can do this switch now as tightly as possible. Cc: Ard Biesheuvel Cc: Jordan Justen Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D394 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 1 + OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf | 1 + OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf | 1 + OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 1 + OvmfPkg/PlatformPei/PlatformPei.inf | 1 + OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf | 1 + OvmfPkg/Include/Library/QemuFwCfgLib.h | 14 ---= ------- OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h | 1 + ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 17 ---= --------- OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 1 + OvmfPkg/Library/LockBoxLib/LockBoxDxe.c | 1 + OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 28 ---= ----------------- OvmfPkg/PlatformPei/Platform.c | 1 + OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c | 1 + 14 files changed, 11 insertions(+), 59 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlat= formDxe/AcpiPlatformDxe.inf index bb5f14e0fc7a..42edc97b3da2 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -52,6 +52,7 @@ [LibraryClasses] UefiDriverEntryPoint HobLib QemuFwCfgLib + QemuFwCfgS3Lib MemoryAllocationLib BaseLib DxeServicesTableLib diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf b/OvmfPkg= /AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf index e550ff5a4714..a9350540215d 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf @@ -44,6 +44,7 @@ [LibraryClasses] MemoryAllocationLib OrderedCollectionLib QemuFwCfgLib + QemuFwCfgS3Lib UefiBootServicesTableLib UefiDriverEntryPoint =20 diff --git a/OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf b/OvmfPkg/Library= /LockBoxLib/LockBoxDxeLib.inf index bedf1811e0b2..eb03f4f546bc 100644 --- a/OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf +++ b/OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf @@ -40,6 +40,7 @@ [LibraryClasses] DebugLib UefiBootServicesTableLib QemuFwCfgLib + QemuFwCfgS3Lib =20 [Protocols] gEfiLockBoxProtocolGuid ## SOMETIMES_PRODUCES diff --git a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.= inf b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index f9e35c955d4d..27789b7377bc 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -52,6 +52,7 @@ [LibraryClasses] PciLib NvVarsFileLib QemuFwCfgLib + QemuFwCfgS3Lib LoadLinuxLib QemuBootOrderLib UefiLib diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/Plat= formPei.inf index fbaed3182dcf..53c6dd445a0e 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -58,6 +58,7 @@ [LibraryClasses] PeiServicesTablePointerLib PeimEntryPoint QemuFwCfgLib + QemuFwCfgS3Lib MtrrLib PcdLib =20 diff --git a/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf b/OvmfPkg/SmmControl= 2Dxe/SmmControl2Dxe.inf index 31c80bd4448c..04b1ed0e4eb3 100644 --- a/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf +++ b/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf @@ -56,6 +56,7 @@ [LibraryClasses] PcdLib PciLib QemuFwCfgLib + QemuFwCfgS3Lib UefiBootServicesTableLib UefiDriverEntryPoint =20 diff --git a/OvmfPkg/Include/Library/QemuFwCfgLib.h b/OvmfPkg/Include/Libra= ry/QemuFwCfgLib.h index 2a1261327b01..596e3f25d5fe 100644 --- a/OvmfPkg/Include/Library/QemuFwCfgLib.h +++ b/OvmfPkg/Include/Library/QemuFwCfgLib.h @@ -179,19 +179,5 @@ QemuFwCfgFindFile ( OUT UINTN *Size ); =20 - -/** - Determine if S3 support is explicitly enabled. - - @retval TRUE if S3 support is explicitly enabled. - FALSE otherwise. This includes unavailability of the firmware - configuration interface. -**/ -BOOLEAN -EFIAPI -QemuFwCfgS3Enabled ( - VOID - ); - #endif =20 diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h b/OvmfPkg= /Library/PlatformBootManagerLib/BdsPlatform.h index ec58efa5ef4a..97ffbb514825 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h @@ -48,6 +48,7 @@ Abstract: #include #include #include +#include #include =20 #include diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/ArmVirtPkg/Li= brary/QemuFwCfgLib/QemuFwCfgLib.c index 9dd5c911fc5c..fba1684af2b2 100644 --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c +++ b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c @@ -637,20 +637,3 @@ QemuFwCfgFindFile ( =20 return RETURN_NOT_FOUND; } - - -/** - Determine if S3 support is explicitly enabled. - - @retval TRUE if S3 support is explicitly enabled. - FALSE otherwise. This includes unavailability of the firmware - configuration interface. -**/ -BOOLEAN -EFIAPI -QemuFwCfgS3Enabled ( - VOID - ) -{ - return FALSE; -} diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatform= Dxe/QemuFwCfgAcpi.c index 6a0ecd1ad962..76512534f5e0 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/OvmfPkg/Library/LockBoxLib/LockBoxDxe.c b/OvmfPkg/Library/Lock= BoxLib/LockBoxDxe.c index 818646a275a9..3da9cd21e5c9 100644 --- a/OvmfPkg/Library/LockBoxLib/LockBoxDxe.c +++ b/OvmfPkg/Library/LockBoxLib/LockBoxDxe.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include =20 diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/= QemuFwCfgLib/QemuFwCfgLib.c index 3dd55ba5042e..1bf725d8b7ae 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c @@ -368,31 +368,3 @@ QemuFwCfgFindFile ( =20 return RETURN_NOT_FOUND; } - - -/** - Determine if S3 support is explicitly enabled. - - @retval TRUE if S3 support is explicitly enabled. - FALSE otherwise. This includes unavailability of the firmware - configuration interface. -**/ -BOOLEAN -EFIAPI -QemuFwCfgS3Enabled ( - VOID - ) -{ - RETURN_STATUS Status; - FIRMWARE_CONFIG_ITEM FwCfgItem; - UINTN FwCfgSize; - UINT8 SystemStates[6]; - - Status =3D QemuFwCfgFindFile ("etc/system-states", &FwCfgItem, &FwCfgSiz= e); - if (Status !=3D RETURN_SUCCESS || FwCfgSize !=3D sizeof SystemStates) { - return FALSE; - } - QemuFwCfgSelectItem (FwCfgItem); - QemuFwCfgReadBytes (sizeof SystemStates, SystemStates); - return (BOOLEAN) (SystemStates[3] & BIT7); -} diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 0be86722e548..77a8a16c15b8 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c b/OvmfPkg/SmmControl2D= xe/SmmControl2Dxe.c index f31646d73461..bb79fce0855b 100644 --- a/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c +++ b/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel