From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 06E4182218 for ; Tue, 21 Feb 2017 07:38:28 -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 99AAF3B755; Tue, 21 Feb 2017 15:38:28 +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 v1LFcGVF015879; Tue, 21 Feb 2017 10:38:27 -0500 From: Laszlo Ersek To: edk2-devel-01 Cc: Jordan Justen Date: Tue, 21 Feb 2017 16:38:11 +0100 Message-Id: <20170221153812.1420-6-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.30]); Tue, 21 Feb 2017 15:38:28 +0000 (UTC) Subject: [PATCH 5/6] OvmfPkg/QemuFwCfg: introduce FW_CFG_IO_DATA, 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: , X-List-Received-Date: Tue, 21 Feb 2017 15:38:28 -0000 Introduce the FW_CFG_IO_DATA macro for IO Port 0x511 (the Data 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 | 1 + OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 6 +++--- OvmfPkg/SmmControl2Dxe/SmiFeatures.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h b/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h index 776bfe88ae2b..5da6b456febe 100644 --- a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h +++ b/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h @@ -47,6 +47,7 @@ // platforms (Ia32 and X64). // #define FW_CFG_IO_SELECTOR 0x510 +#define FW_CFG_IO_DATA 0x511 // // Numerically defined keys. diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c index 1387ea85f3f0..d79d0a444ca7 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c @@ -135,7 +135,7 @@ InternalQemuFwCfgReadBytes ( InternalQemuFwCfgDmaBytes ((UINT32)Size, Buffer, FW_CFG_DMA_CTL_READ); return; } - IoReadFifo8 (0x511, Size, Buffer); + IoReadFifo8 (FW_CFG_IO_DATA, Size, Buffer); } @@ -187,7 +187,7 @@ QemuFwCfgWriteBytes ( InternalQemuFwCfgDmaBytes ((UINT32)Size, Buffer, FW_CFG_DMA_CTL_WRITE); return; } - IoWriteFifo8 (0x511, Size, Buffer); + IoWriteFifo8 (FW_CFG_IO_DATA, Size, Buffer); } } @@ -230,7 +230,7 @@ QemuFwCfgSkipBytes ( // while (Size > 0) { ChunkSize = MIN (Size, sizeof SkipBuffer); - IoReadFifo8 (0x511, ChunkSize, SkipBuffer); + IoReadFifo8 (FW_CFG_IO_DATA, ChunkSize, SkipBuffer); Size -= ChunkSize; } } diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c index 352ffa017373..73c29848b334 100644 --- a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c +++ b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c @@ -303,7 +303,7 @@ SaveSmiFeatures ( S3SaveState, // This EFI_BOOT_SCRIPT_IO_POLL_OPCODE, // OpCode EfiBootScriptWidthUint8, // Width - (UINT64)(UINTN)0x511, // Address + (UINT64)(UINTN)FW_CFG_IO_DATA, // Address &FeaturesOkData, // Data &FeaturesOkMask, // DataMask MAX_UINT64 // Delay -- 2.9.3