From nobody Sat Nov 2 16:23:39 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 1487691511317403.63741138815567; Tue, 21 Feb 2017 07:38:31 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6583E82226; Tue, 21 Feb 2017 07:38:27 -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 C7DF382225 for ; Tue, 21 Feb 2017 07:38:26 -0800 (PST) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 63CE0C057FA9; Tue, 21 Feb 2017 15:38:27 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-47.phx2.redhat.com [10.3.116.47]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LFcGVE015879; Tue, 21 Feb 2017 10:38:25 -0500 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 21 Feb 2017 16:38:10 +0100 Message-Id: <20170221153812.1420-5-lersek@redhat.com> In-Reply-To: <20170221153812.1420-1-lersek@redhat.com> References: <20170221153812.1420-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 21 Feb 2017 15:38:27 +0000 (UTC) Subject: [edk2] [PATCH 4/6] OvmfPkg/QemuFwCfg: introduce FW_CFG_IO_SELECTOR, adapt the package 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 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" Introduce the FW_CFG_IO_SELECTOR macro for IO Port 0x510 (the Selector Register), and update all references in OvmfPkg. Cc: Jordan Justen Suggested-by: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/Include/IndustryStandard/QemuFwCfg.h | 6 ++++++ OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 2 +- OvmfPkg/SmmControl2Dxe/SmiFeatures.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h b/OvmfPkg/Include= /IndustryStandard/QemuFwCfg.h index c7e9b5c382a5..776bfe88ae2b 100644 --- a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h +++ b/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h @@ -43,6 +43,12 @@ #define FW_CFG_DMA_CTL_WRITE BIT4 =20 // +// The fw_cfg registers can be found at these IO Ports, on the IO-mapped +// platforms (Ia32 and X64). +// +#define FW_CFG_IO_SELECTOR 0x510 + +// // Numerically defined keys. // typedef enum { diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/= QemuFwCfgLib/QemuFwCfgLib.c index 7744873217fe..1387ea85f3f0 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c @@ -42,7 +42,7 @@ QemuFwCfgSelectItem ( ) { DEBUG ((EFI_D_INFO, "Select Item: 0x%x\n", (UINT16)(UINTN) QemuFwCfgItem= )); - IoWrite16 (0x510, (UINT16)(UINTN) QemuFwCfgItem); + IoWrite16 (FW_CFG_IO_SELECTOR, (UINT16)(UINTN) QemuFwCfgItem); } =20 =20 diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c b/OvmfPkg/SmmControl2Dxe/= SmiFeatures.c index e070969065c0..352ffa017373 100644 --- a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c +++ b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c @@ -281,7 +281,7 @@ SaveSmiFeatures ( S3SaveState, // This EFI_BOOT_SCRIPT_IO_WRITE_OPCODE, // OpCode EfiBootScriptWidthUint16, // Width - (UINT64)0x510, // Address + (UINT64)FW_CFG_IO_SELECTOR, // Address (UINTN)1, // Count &FeaturesOkItemAsUint16 // Buffer ); --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel