From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B530581F50 for ; Mon, 5 Dec 2016 02:29:51 -0800 (PST) Received: by mail-wm0-x232.google.com with SMTP id c184so19198696wmd.0 for ; Mon, 05 Dec 2016 02:29:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3Tl6TiyKCjFE/r+OB74dKelh1lBRoypG799rKDC9AaQ=; b=EecRCJUgKH5JBUbC2SfwE5ZvQ2SgBiFVhIEWqRntJZtJnsnvQkgH/zvJ6gMc/ylZdc UEtuHTQGTkf12b/KP+gJYZljtJretWtZtwKwqHiuUQ8TFQjeRA6ZiHPaj96liNG7EKlv 6yX9fUOSZdHm9SMJj7vT5RkLJ3cI90OYUSPGs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3Tl6TiyKCjFE/r+OB74dKelh1lBRoypG799rKDC9AaQ=; b=dr3XcClsP39+KUfKN6Bpdi1ZLb8W/eKCdwx12sojWH2RwUD8qG8e8sb6tlD+n98+Dq ekzyKn70PGDTs9nsNe0tAhe2oeqp2g2a98/FNxoQwTKk8buJ43PsSJJj2mqC9eUYeX3I q88YTVWuf5TpXVsFV8kb0AJn0HBXdA7/tZdymS/eJnlXvL3lNP6aDlNQjdZ3X8RYHmIQ tzkyJAbzG2zulJ+9YGiQVBuRfHl2VzANEKTH6fUBzixhMXM545sfOg/zUCYgEVcRLAvy yQEWAm2BszZ5nYTNTu6ughAyJ0aUw0FGDiQicLps2Qlx2/6FSKylVKBqoGJuJoSRf5Qg Byxg== X-Gm-Message-State: AKaTC00RY5Toaf/SSufNo16+7jJ39+894KydmoI0xEY4e4RxZabjqdqw9FN5NlGSva0EuR1k X-Received: by 10.28.131.72 with SMTP id f69mr8098486wmd.135.1480933790000; Mon, 05 Dec 2016 02:29:50 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id 197sm17306919wmy.16.2016.12.05.02.29.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Dec 2016 02:29:49 -0800 (PST) Date: Mon, 5 Dec 2016 10:29:47 +0000 From: Leif Lindholm To: Laszlo Ersek Cc: edk2-devel-01 , Ard Biesheuvel , Jordan Justen Message-ID: <20161205102947.GF27069@bivouac.eciton.net> References: <20161202202059.5061-1-lersek@redhat.com> <20161202202059.5061-4-lersek@redhat.com> MIME-Version: 1.0 In-Reply-To: <20161202202059.5061-4-lersek@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH v2 3/6] ArmVirtPkg, OvmfPkg: QemuFwCfgLib: move DMA-related defs to lib class 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: Mon, 05 Dec 2016 10:29:52 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Dec 02, 2016 at 09:20:56PM +0100, Laszlo Ersek wrote: > Move the type and macro definitions related to QEMU's DMA-like fw_cfg > access method to the library class header. > > Cc: Ard Biesheuvel > Cc: Jordan Justen > Cc: Leif Lindholm > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Laszlo Ersek Ard may be back from holiday, but fwiw: Reviewed-by: Leif Lindholm > --- > > Notes: > v2: > - move definitions to lib class header rather than to a new > IndustryStandard include [Jordan] > - because ArmVirtPkg's library instance already includes the lib class > header, the code movement must be atomic and straddle both packages > - restrict patch to code movement solely; FW_CFG_F_DMA and > FW_CFG_DMA_CTL_WRITE will be added separately > > OvmfPkg/Include/Library/QemuFwCfgLib.h | 19 +++++++++++++++++++ > ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 20 -------------------- > 2 files changed, 19 insertions(+), 20 deletions(-) > > diff --git a/OvmfPkg/Include/Library/QemuFwCfgLib.h b/OvmfPkg/Include/Library/QemuFwCfgLib.h > index 7c29422fbd72..40a07456c530 100644 > --- a/OvmfPkg/Include/Library/QemuFwCfgLib.h > +++ b/OvmfPkg/Include/Library/QemuFwCfgLib.h > @@ -23,6 +23,14 @@ > // > #define QEMU_FW_CFG_FNAME_SIZE 56 > > +// > +// 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 > + > typedef enum { > QemuFwCfgItemSignature = 0x0000, > QemuFwCfgItemInterfaceVersion = 0x0001, > @@ -59,6 +67,17 @@ typedef enum { > > } FIRMWARE_CONFIG_ITEM; > > +// > +// Communication structure for the DMA access method. All fields are encoded in > +// big endian. > +// > +#pragma pack (1) > +typedef struct { > + UINT32 Control; > + UINT32 Length; > + UINT64 Address; > +} FW_CFG_DMA_ACCESS; > +#pragma pack () > > /** > Returns a boolean indicating if the firmware configuration interface > diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c > index 2fd8d9050566..6033a2a14c42 100644 > --- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c > +++ b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c > @@ -53,26 +53,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 > -- > 2.9.2 > >