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 77F4081A10 for ; Fri, 6 Jan 2017 08:40:26 -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 F0668129203; Fri, 6 Jan 2017 16:40:26 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-54.phx2.redhat.com [10.3.116.54]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v06GeMP9007768; Fri, 6 Jan 2017 11:40:23 -0500 To: Leo Duran , edk2-devel@ml01.01.org References: <1483719899-16125-1-git-send-email-leo.duran@amd.com> <1483719899-16125-10-git-send-email-leo.duran@amd.com> Cc: brijesh.singh@amd.com, jordan.l.justen@intel.com, jeff.fan@intel.com, michael.d.kinney@intel.com, liming.gao@intel.com, maurice.ma@intel.com, prince.agyeman@intel.com, ruiyu.ni@intel.com, kelly.steele@intel.com, david.wei@intel.com, mang.guo@intel.com From: Laszlo Ersek Message-ID: <6b2dff56-8916-1b52-2a4b-bf8cba9345e0@redhat.com> Date: Fri, 6 Jan 2017 17:40:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1483719899-16125-10-git-send-email-leo.duran@amd.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.38]); Fri, 06 Jan 2017 16:40:27 +0000 (UTC) Subject: Re: [PATCH v4 9/9] Modify QemuFwCfgLib to use new BaseIoFifoLib library. 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: Fri, 06 Jan 2017 16:40:26 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 01/06/17 17:24, Leo Duran wrote: > From: Brijesh Singh > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Brijesh Singh > Signed-off-by: Leo Duran > --- > OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.nasm | 55 ----------------------- > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 55 +---------------------- > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf | 8 +--- > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf | 8 +--- > OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.nasm | 52 --------------------- > 5 files changed, 6 insertions(+), 172 deletions(-) > delete mode 100644 OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.nasm > delete mode 100644 OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.nasm I should have suggested an improvement to the subject line earlier: OvmfPkg/QemuFwCfgLib: use new BaseIoFifoLib library There's no need to repost the series just because of this; we can fix up the subject at commit / push. Reviewed-by: Laszlo Ersek Thanks Laszlo > diff --git a/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.nasm b/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.nasm > deleted file mode 100644 > index faa22e9..0000000 > --- a/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.nasm > +++ /dev/null > @@ -1,55 +0,0 @@ > -;------------------------------------------------------------------------------ > -; > -; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
> -; This program and the accompanying materials > -; are licensed and made available under the terms and conditions of the BSD License > -; which accompanies this distribution. The full text of the license may be found at > -; http://opensource.org/licenses/bsd-license.php. > -; > -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. > -; > -;------------------------------------------------------------------------------ > - > - SECTION .text > - > -;------------------------------------------------------------------------------ > -; VOID > -; EFIAPI > -; IoReadFifo8 ( > -; IN UINTN Port, > -; IN UINTN Size, > -; IN VOID *Buffer > -; ); > -;------------------------------------------------------------------------------ > -global ASM_PFX(IoReadFifo8) > -ASM_PFX(IoReadFifo8): > - > - mov dx, [esp + 4] > - mov ecx, [esp + 8] > - push edi > - mov edi, [esp + 16] > -rep insb > - pop edi > - ret > - > -;------------------------------------------------------------------------------ > -; VOID > -; EFIAPI > -; IoWriteFifo8 ( > -; IN UINTN Port, > -; IN UINTN Size, > -; IN VOID *Buffer > -; ); > -;------------------------------------------------------------------------------ > -global ASM_PFX(IoWriteFifo8) > -ASM_PFX(IoWriteFifo8): > - > - mov dx, [esp + 4] > - mov ecx, [esp + 8] > - push esi > - mov esi, [esp + 16] > -rep outsb > - pop esi > - ret > - > diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c > index 0bbf121..d2f7fc6 100644 > --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c > +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c > @@ -2,6 +2,7 @@ > > Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.
> Copyright (C) 2013, Red Hat, Inc. > + Copyright (c) 2017, AMD Inc. All rights reserved.
> > This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD License > @@ -18,6 +19,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -26,59 +28,6 @@ > > > /** > - Reads an 8-bit I/O port fifo into a block of memory. > - > - Reads the 8-bit I/O fifo port specified by Port. > - > - The port is read Count times, and the read data is > - stored in the provided Buffer. > - > - This function must guarantee that all I/O read and write operations are > - serialized. > - > - If 8-bit I/O port operations are not supported, then ASSERT(). > - > - @param Port The I/O port to read. > - @param Count The number of times to read I/O port. > - @param Buffer The buffer to store the read data into. > - > -**/ > -VOID > -EFIAPI > -IoReadFifo8 ( > - IN UINTN Port, > - IN UINTN Count, > - OUT VOID *Buffer > - ); > - > -/** > - Writes an 8-bit I/O port fifo from a block of memory. > - > - Writes the 8-bit I/O fifo port specified by Port. > - > - The port is written Count times, and the data are obtained > - from the provided Buffer. > - > - This function must guarantee that all I/O read and write operations are > - serialized. > - > - If 8-bit I/O port operations are not supported, then ASSERT(). > - > - @param Port The I/O port to read. > - @param Count The number of times to read I/O port. > - @param Buffer The buffer to store the read data into. > - > -**/ > -VOID > -EFIAPI > -IoWriteFifo8 ( > - IN UINTN Port, > - IN UINTN Count, > - OUT VOID *Buffer > - ); > - > - > -/** > Selects a firmware configuration item for reading. > > Following this call, any data read from this item will start from > diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf > index 66ac778..e48c639 100644 > --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf > +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf > @@ -4,6 +4,7 @@ > # > # Copyright (C) 2013, Red Hat, Inc. > # Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
> +# Copyright (c) 2017, AMD Inc. All rights reserved.
> # > # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the BSD License > @@ -36,12 +37,6 @@ [Sources] > QemuFwCfgLib.c > QemuFwCfgPeiDxe.c > > -[Sources.IA32] > - Ia32/IoLibExAsm.nasm > - > -[Sources.X64] > - X64/IoLibExAsm.nasm > - > [Packages] > MdePkg/MdePkg.dec > OvmfPkg/OvmfPkg.dec > @@ -51,5 +46,6 @@ [LibraryClasses] > BaseMemoryLib > DebugLib > IoLib > + IoFifoLib > MemoryAllocationLib > > diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf > index c1d6a54..6275ba9 100644 > --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf > +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf > @@ -4,6 +4,7 @@ > # > # Copyright (C) 2013, Red Hat, Inc. > # Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
> +# Copyright (c) 2017, AMD Inc. All rights reserved.
> # > # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the BSD License > @@ -34,12 +35,6 @@ [Sources] > QemuFwCfgLib.c > QemuFwCfgSec.c > > -[Sources.IA32] > - Ia32/IoLibExAsm.nasm > - > -[Sources.X64] > - X64/IoLibExAsm.nasm > - > [Packages] > MdePkg/MdePkg.dec > OvmfPkg/OvmfPkg.dec > @@ -49,5 +44,6 @@ [LibraryClasses] > BaseMemoryLib > DebugLib > IoLib > + IoFifoLib > MemoryAllocationLib > > diff --git a/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.nasm b/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.nasm > deleted file mode 100644 > index f1078f2..0000000 > --- a/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.nasm > +++ /dev/null > @@ -1,52 +0,0 @@ > -;------------------------------------------------------------------------------ > -; > -; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
> -; This program and the accompanying materials > -; are licensed and made available under the terms and conditions of the BSD License > -; which accompanies this distribution. The full text of the license may be found at > -; http://opensource.org/licenses/bsd-license.php. > -; > -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. > -; > -;------------------------------------------------------------------------------ > - > - DEFAULT REL > - SECTION .text > - > -;------------------------------------------------------------------------------ > -; VOID > -; EFIAPI > -; IoReadFifo8 ( > -; IN UINTN Port, // rcx > -; IN UINTN Size, // rdx > -; IN VOID *Buffer // r8 > -; ); > -;------------------------------------------------------------------------------ > -global ASM_PFX(IoReadFifo8) > -ASM_PFX(IoReadFifo8): > - > - xchg rcx, rdx > - xchg rdi, r8 ; rdi: buffer address; r8: save rdi > -rep insb > - mov rdi, r8 ; restore rdi > - ret > - > -;------------------------------------------------------------------------------ > -; VOID > -; EFIAPI > -; IoWriteFifo8 ( > -; IN UINTN Port, // rcx > -; IN UINTN Size, // rdx > -; IN VOID *Buffer // r8 > -; ); > -;------------------------------------------------------------------------------ > -global ASM_PFX(IoWriteFifo8) > -ASM_PFX(IoWriteFifo8): > - > - xchg rcx, rdx > - xchg rsi, r8 ; rdi: buffer address; r8: save rdi > -rep outsb > - mov rsi, r8 ; restore rdi > - ret > - >