From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 846F281D79 for ; Sun, 15 Jan 2017 16:49:36 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP; 15 Jan 2017 16:49:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,236,1477983600"; d="scan'208";a="213714956" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 15 Jan 2017 16:49:36 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 15 Jan 2017 16:49:36 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 15 Jan 2017 16:49:35 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Mon, 16 Jan 2017 08:49:32 +0800 From: "Fan, Jeff" To: Leo Duran , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Kinney, Michael D" , "Justen, Jordan L" , "lersek@redhat.com" , "brijesh.singh@amd.com" Thread-Topic: [PATCH v3 02/10] UefiCpuPkg: Modify CpuIo2Dxe to use new IoLib library Thread-Index: AQHSbdkhGPuK5PE6UEqT52Mj2Ny3qKE6SP2A Date: Mon, 16 Jan 2017 00:49:31 +0000 Message-ID: <542CF652F8836A4AB8DBFAAD40ED192A4C516FF9@shsmsx102.ccr.corp.intel.com> References: <1484338200-31337-1-git-send-email-leo.duran@amd.com> <1484338200-31337-3-git-send-email-leo.duran@amd.com> In-Reply-To: <1484338200-31337-3-git-send-email-leo.duran@amd.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmQyOTRjZmMtMzQzYi00ZjZjLWEzZDYtZmQwYzJiY2I2ZDIzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlpzUzFRT2gyaUhPWUxhRDg0aVp5V3lEVlAyakdqQ2dQdGprTnZhXC9TbGxFPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v3 02/10] UefiCpuPkg: Modify CpuIo2Dxe to use new IoLib 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: Mon, 16 Jan 2017 00:49:36 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jeff Fan -----Original Message----- From: Leo Duran [mailto:leo.duran@amd.com]=20 Sent: Saturday, January 14, 2017 4:10 AM To: edk2-devel@lists.01.org Cc: Gao, Liming; Kinney, Michael D; Fan, Jeff; Justen, Jordan L; lersek@red= hat.com; brijesh.singh@amd.com; Leo Duran Subject: [PATCH v3 02/10] UefiCpuPkg: Modify CpuIo2Dxe to use new IoLib lib= rary The Fifo routines from the UefiCpuPkg/CpuIo2Dxe driver have been moved to t= he new BaseIoLibIntrinsic (IoLib class) library. Cc: Jeff Fan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh Signed-off-by: Leo Duran --- UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.c | 13 ++- UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf | 11 +-- UefiCpuPkg/CpuIo2Dxe/Ia32/IoFifo.asm | 140 --------------------------- U= efiCpuPkg/CpuIo2Dxe/Ia32/IoFifo.nasm | 136 -------------------------- UefiCpuPkg/CpuIo2Dxe/IoFifo.h | 176 ------------------------------= ---- UefiCpuPkg/CpuIo2Dxe/X64/IoFifo.asm | 126 ------------------------ UefiCpuPkg/CpuIo2Dxe/X64/IoFifo.nasm | 125 ------------------------ 7 files changed, 10 insertions(+), 717 deletions(-) delete mode 100644 Ue= fiCpuPkg/CpuIo2Dxe/Ia32/IoFifo.asm delete mode 100644 UefiCpuPkg/CpuIo2Dxe/Ia32/IoFifo.nasm delete mode 100644 UefiCpuPkg/CpuIo2Dxe/IoFifo.h delete mode 100644 UefiC= puPkg/CpuIo2Dxe/X64/IoFifo.asm delete mode 100644 UefiCpuPkg/CpuIo2Dxe/X64/IoFifo.nasm diff --git a/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.c b/UefiCpuPkg/CpuIo2Dxe/CpuIo2= Dxe.c index 6ccfc40..60f4bbc 100644 --- a/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.c +++ b/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.c @@ -2,6 +2,8 @@ Produces the CPU I/O 2 Protocol. =20 Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2017, AMD Incorporated. All rights reserved.
+ This program and the accompanying materials =20 are licensed and made available under the terms and conditions of the BSD = License =20 which accompanies this distribution. The full text of the license may be = found at =20 @@ -13,7 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER= EXPRESS OR IMPLIED. **/ =20 #include "CpuIo2Dxe.h" -#include "IoFifo.h" =20 // // Handle for the CPU I/O 2 Protocol @@ -412,7 +413,9 @@ CpuIoServiceRead ( OutStride =3D mOutStride[Width]; OperationWidth =3D (EFI_CPU_IO_PROTOCOL_WIDTH) (Width & 0x03); =20 -#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64) + // + // Fifo operations supported for (mInStride[Width] =3D=3D 0) // if (InStride =3D=3D 0) { switch (OperationWidth) { case EfiCpuIoWidthUint8: @@ -433,7 +436,6 @@ CpuIoServiceRead ( break; } } -#endif =20 for (Uint8Buffer =3D Buffer; Count > 0; Address +=3D InStride, Uint8Buff= er +=3D OutStride, Count--) { if (OperationWidth =3D=3D EfiCpuIoWidthUint8) { @@ -518,7 +520,9 @@ Cp= uIoServiceWrite ( OutStride =3D mOutStride[Width]; OperationWidth =3D (EFI_CPU_IO_PROTOCOL_WIDTH) (Width & 0x03); =20 -#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64) + // + // Fifo operations supported for (mInStride[Width] =3D=3D 0) // if (InStride =3D=3D 0) { switch (OperationWidth) { case EfiCpuIoWidthUint8: @@ -539,7 +543,6 @@ CpuIoServiceWrite ( break; } } -#endif =20 for (Uint8Buffer =3D (UINT8 *)Buffer; Count > 0; Address +=3D InStride, = Uint8Buffer +=3D OutStride, Count--) { if (OperationWidth =3D=3D EfiCpuIoWidthUint8) { diff --git a/UefiCpuPk= g/CpuIo2Dxe/CpuIo2Dxe.inf b/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf index 920ede7..5503662 100644 --- a/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf +++ b/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf @@ -2,6 +2,8 @@ # Produces the CPU I/O 2 Protocol by using the services of the I/O Librar= y. # # Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2017, AMD Incorporated. All rights reserved.
# # This program and the accompanying materials # are licensed and made ava= ilable under the terms and conditions of the BSD License # which accompani= es this distribution. The full text of the license may be found at @@ -30,= 15 +32,6 @@ [Defines] [Sources] CpuIo2Dxe.c CpuIo2Dxe.h - IoFifo.h - -[Sources.IA32] - Ia32/IoFifo.nasm - Ia32/IoFifo.asm - -[Sources.X64] - X64/IoFifo.nasm - X64/IoFifo.asm =20 [Packages] MdePkg/MdePkg.dec diff --git a/UefiCpuPkg/CpuIo2Dxe/Ia32/IoFifo.asm b/UefiCpuPkg/CpuIo2Dxe/Ia= 32/IoFifo.asm deleted file mode 100644 index b1cc25e..0000000 --- a/UefiCpuPkg/CpuIo2Dxe/Ia32/IoFifo.asm +++ /dev/null @@ -1,140 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-= ; -; This program and the accompanying materials are licensed and made avai= lable -; under the terms and conditions of the BSD License which accompanie= s this -; distribution. The full text of the license may be found at -; ht= tp://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 IMPLI= ED. -; -;-------------------------------------------------------------------------= ----- - - .586P - .model flat,C - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo8 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -IoReadFifo8 PROC - push edi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov edi, [esp + 16] -rep insb - pop edi - ret -IoReadFifo8 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo16 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -IoReadFifo16 PROC - push edi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov edi, [esp + 16] -rep insw - pop edi - ret -IoReadFifo16 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo32 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -IoReadFifo32 PROC - push edi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov edi, [esp + 16] -rep insd - pop edi - ret -IoReadFifo32 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo8 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -IoWriteFifo8 PROC - push esi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov esi, [esp + 16] -rep outsb - pop esi - ret -IoWriteFifo8 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo16 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -IoWriteFifo16 PROC - push esi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov esi, [esp + 16] -rep outsw - pop esi - ret -IoWriteFifo16 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo32 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -IoWriteFifo32 PROC - push esi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov esi, [esp + 16] -rep outsd - pop esi - ret -IoWriteFifo32 ENDP - - END - diff --git a/UefiCpuPkg/CpuIo2Dxe/Ia32/IoFifo.nasm b/UefiCpuPkg/CpuIo2Dxe/I= a32/IoFifo.nasm deleted file mode 100644 index daa90a9..0000000 --- a/UefiCpuPkg/CpuIo2Dxe/Ia32/IoFifo.nasm +++ /dev/null @@ -1,136 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-= ; -; This program and the accompanying materials are licensed and made avai= lable -; under the terms and conditions of the BSD License which accompanie= s this -; distribution. The full text of the license may be found at -; ht= tp://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 IMPLI= ED. -; -;-------------------------------------------------------------------------= ----- - - SECTION .text - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo8 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoReadFifo8) -ASM_PFX(IoReadFifo8): - push edi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov edi, [esp + 16] -rep insb - pop edi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo16 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoReadFifo16) -ASM_PFX(IoReadFifo16): - push edi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov edi, [esp + 16] -rep insw - pop edi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo32 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoReadFifo32) -ASM_PFX(IoReadFifo32): - push edi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov edi, [esp + 16] -rep insd - pop edi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo8 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoWriteFifo8) -ASM_PFX(IoWriteFifo8): - push esi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov esi, [esp + 16] -rep outsb - pop esi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo16 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoWriteFifo16) -ASM_PFX(IoWriteFifo16): - push esi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov esi, [esp + 16] -rep outsw - pop esi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo32 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoWriteFifo32) -ASM_PFX(IoWriteFifo32): - push esi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov esi, [esp + 16] -rep outsd - pop esi - ret - diff --git a/UefiCpuPkg/CpuIo2Dxe/IoFifo.h b/UefiCpuPkg/CpuIo2Dxe/IoFifo.h = deleted file mode 100644 index 9978f8b..0000000 --- a/UefiCpuPkg/CpuIo2Dxe/IoFifo.h +++ /dev/null @@ -1,176 +0,0 @@ -/** @file - I/O FIFO routines - - Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
- - This program and the accompanying materials are licensed and made availa= ble - 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 IMP= LIED. - -**/ - -#ifndef _IO_FIFO_H_INCLUDED_ -#define _IO_FIFO_H_INCLUDED_ - -/** - 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 - ); - -/** - Reads a 16-bit I/O port fifo into a block of memory. - - Reads the 16-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 16-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 -IoReadFifo16 ( - IN UINTN Port, - IN UINTN Count, - OUT VOID *Buffer - ); - -/** - Reads a 32-bit I/O port fifo into a block of memory. - - Reads the 32-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 32-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 -IoReadFifo32 ( - IN UINTN Port, - IN UINTN Count, - OUT VOID *Buffer - ); - -/** - Writes a block of memory into an 8-bit I/O port fifo. - - Writes the 8-bit I/O fifo port specified by Port. - - The port is written Count times, and the write data is - retrieved from the provided Buffer. - - This function must guarantee that all I/O write and write operations are - serialized. - - If 8-bit I/O port operations are not supported, then ASSERT(). - - @param Port The I/O port to write. - @param Count The number of times to write I/O port. - @param Buffer The buffer to store the write data into. - -**/ -VOID -EFIAPI -IoWriteFifo8 ( - IN UINTN Port, - IN UINTN Count, - OUT VOID *Buffer - ); - -/** - Writes a block of memory into a 16-bit I/O port fifo. - - Writes the 16-bit I/O fifo port specified by Port. - - The port is written Count times, and the write data is - retrieved from the provided Buffer. - - This function must guarantee that all I/O write and write operations are - serialized. - - If 16-bit I/O port operations are not supported, then ASSERT(). - - @param Port The I/O port to write. - @param Count The number of times to write I/O port. - @param Buffer The buffer to store the write data into. - -**/ -VOID -EFIAPI -IoWriteFifo16 ( - IN UINTN Port, - IN UINTN Count, - OUT VOID *Buffer - ); - -/** - Writes a block of memory into a 32-bit I/O port fifo. - - Writes the 32-bit I/O fifo port specified by Port. - - The port is written Count times, and the write data is - retrieved from the provided Buffer. - - This function must guarantee that all I/O write and write operations are - serialized. - - If 32-bit I/O port operations are not supported, then ASSERT(). - - @param Port The I/O port to write. - @param Count The number of times to write I/O port. - @param Buffer The buffer to store the write data into. - -**/ -VOID -EFIAPI -IoWriteFifo32 ( - IN UINTN Port, - IN UINTN Count, - OUT VOID *Buffer - ); - -#endif - diff --git a/UefiCpuPkg/CpuIo2Dxe/X64/IoFifo.asm b/UefiCpuPkg/CpuIo2Dxe/X64= /IoFifo.asm deleted file mode 100644 index 1a3f0ef..0000000 --- a/UefiCpuPkg/CpuIo2Dxe/X64/IoFifo.asm +++ /dev/null @@ -1,126 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-= ; -; This program and the accompanying materials are licensed and made avai= lable -; under the terms and conditions of the BSD License which accompanie= s this -; distribution. The full text of the license may be found at -; ht= tp://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 IMPLI= ED. -; -;-------------------------------------------------------------------------= ----- - - .code - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo8 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -IoReadFifo8 PROC - cld - xchg rcx, rdx - xchg rdi, r8 ; rdi: buffer address; r8: save rdi -rep insb - mov rdi, r8 ; restore rdi - ret -IoReadFifo8 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo16 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -IoReadFifo16 PROC - cld - xchg rcx, rdx - xchg rdi, r8 ; rdi: buffer address; r8: save rdi -rep insw - mov rdi, r8 ; restore rdi - ret -IoReadFifo16 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo32 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -IoReadFifo32 PROC - cld - xchg rcx, rdx - xchg rdi, r8 ; rdi: buffer address; r8: save rdi -rep insd - mov rdi, r8 ; restore rdi - ret -IoReadFifo32 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo8 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -IoWriteFifo8 PROC - cld - xchg rcx, rdx - xchg rsi, r8 ; rsi: buffer address; r8: save rsi -rep outsb - mov rsi, r8 ; restore rsi - ret -IoWriteFifo8 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo16 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -IoWriteFifo16 PROC - cld - xchg rcx, rdx - xchg rsi, r8 ; rsi: buffer address; r8: save rsi -rep outsw - mov rsi, r8 ; restore rsi - ret -IoWriteFifo16 ENDP - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo32 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -IoWriteFifo32 PROC - cld - xchg rcx, rdx - xchg rsi, r8 ; rsi: buffer address; r8: save rsi -rep outsd - mov rsi, r8 ; restore rsi - ret -IoWriteFifo32 ENDP - - END - diff --git a/UefiCpuPkg/CpuIo2Dxe/X64/IoFifo.nasm b/UefiCpuPkg/CpuIo2Dxe/X6= 4/IoFifo.nasm deleted file mode 100644 index bb3d1da..0000000 --- a/UefiCpuPkg/CpuIo2Dxe/X64/IoFifo.nasm +++ /dev/null @@ -1,125 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-= ; -; This program and the accompanying materials are licensed and made avai= lable -; under the terms and conditions of the BSD License which accompanie= s this -; distribution. The full text of the license may be found at -; ht= tp://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 IMPLI= ED. -; -;-------------------------------------------------------------------------= ----- - - 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): - cld - xchg rcx, rdx - xchg rdi, r8 ; rdi: buffer address; r8: save rdi -rep insb - mov rdi, r8 ; restore rdi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo16 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoReadFifo16) -ASM_PFX(IoReadFifo16): - cld - xchg rcx, rdx - xchg rdi, r8 ; rdi: buffer address; r8: save rdi -rep insw - mov rdi, r8 ; restore rdi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo32 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoReadFifo32) -ASM_PFX(IoReadFifo32): - cld - xchg rcx, rdx - xchg rdi, r8 ; rdi: buffer address; r8: save rdi -rep insd - 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): - cld - xchg rcx, rdx - xchg rsi, r8 ; rsi: buffer address; r8: save rsi -rep outsb - mov rsi, r8 ; restore rsi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo16 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoWriteFifo16) -ASM_PFX(IoWriteFifo16): - cld - xchg rcx, rdx - xchg rsi, r8 ; rsi: buffer address; r8: save rsi -rep outsw - mov rsi, r8 ; restore rsi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo32 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoWriteFifo32) -ASM_PFX(IoWriteFifo32): - cld - xchg rcx, rdx - xchg rsi, r8 ; rsi: buffer address; r8: save rsi -rep outsd - mov rsi, r8 ; restore rsi - ret - -- 1.9.1