From patchwork Thu Dec 1 17:56:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 86132 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp810520qgi; Thu, 1 Dec 2016 09:56:49 -0800 (PST) X-Received: by 10.99.106.200 with SMTP id f191mr71090158pgc.143.1480615008921; Thu, 01 Dec 2016 09:56:48 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id j190si973690pgd.278.2016.12.01.09.56.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Dec 2016 09:56:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 43D4481F23; Thu, 1 Dec 2016 09:56:47 -0800 (PST) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org 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 D881981F3F for ; Thu, 1 Dec 2016 09:56:45 -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 53D936918A; Thu, 1 Dec 2016 17:56:45 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-138.phx2.redhat.com [10.3.116.138]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uB1HuaWs018501; Thu, 1 Dec 2016 12:56:44 -0500 From: Laszlo Ersek To: edk2-devel-01 Date: Thu, 1 Dec 2016 18:56:32 +0100 Message-Id: <20161201175633.2538-5-lersek@redhat.com> In-Reply-To: <20161201175633.2538-1-lersek@redhat.com> References: <20161201175633.2538-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.28]); Thu, 01 Dec 2016 17:56:45 +0000 (UTC) Subject: [edk2] [PATCH 4/5] ArmVirtPkg/QemuFwCfgLib: rebase lib instance to OvmfPkg/IndustryStandard 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: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" where "QemuFwCfgDma.h" was added in the previous patch. Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 24 +++----------------- 1 file changed, 3 insertions(+), 21 deletions(-) -- 2.9.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c index 2fd8d9050566..62a85dff328e 100644 --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c +++ b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c @@ -25,6 +25,8 @@ #include +#include + STATIC UINTN mFwCfgSelectorAddress; STATIC UINTN mFwCfgDataAddress; STATIC UINTN mFwCfgDmaAddress; @@ -53,26 +55,6 @@ STATIC READ_BYTES_FUNCTION DmaReadBytes; // STATIC READ_BYTES_FUNCTION *InternalQemuFwCfgReadBytes = MmioReadBytes; -// -// Communication structure for DmaReadBytes(). All fields are encoded in big -// endian. -// -#pragma pack (1) -typedef struct { - UINT32 Control; - UINT32 Length; - UINT64 Address; -} FW_CFG_DMA_ACCESS; -#pragma pack () - -// -// Macros for the FW_CFG_DMA_ACCESS.Control bitmap (in native encoding). -// -#define FW_CFG_DMA_CTL_ERROR BIT0 -#define FW_CFG_DMA_CTL_READ BIT1 -#define FW_CFG_DMA_CTL_SKIP BIT2 -#define FW_CFG_DMA_CTL_SELECT BIT3 - /** Returns a boolean indicating if the firmware configuration interface @@ -183,7 +165,7 @@ QemuFwCfgInitialize ( QemuFwCfgSelectItem (QemuFwCfgItemInterfaceVersion); Features = QemuFwCfgRead32 (); - if ((Features & BIT1) != 0) { + if ((Features & FW_CFG_F_DMA) != 0) { mFwCfgDmaAddress = FwCfgDmaAddress; InternalQemuFwCfgReadBytes = DmaReadBytes; }