From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 64E697803CF for ; Mon, 11 Dec 2023 21:12:20 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=BwzTYyNl1233BijuAR/x6kUAVnlSO5h1r97PyMtD9xI=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1702329139; v=1; b=nQL22ZQUJ1PZZXG47mEOp7+B39vaJZVs6OYcWBvgXsnJO0zSkXoRErURcPvPQ/6dfTQI5tJf kTMcYm15vWgmUlcks7t7IxmBFJl0RPaPSQVI99HjHJsMmok785QOK+c7aIHMlBlyWtn2tjSoQgW v8UYas7KIX0Vv+GrP5S8X7p8= X-Received: by 127.0.0.2 with SMTP id hdYiYY7687511xrL8xAMKL4T; Mon, 11 Dec 2023 13:12:19 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.3064.1702329138125950584 for ; Mon, 11 Dec 2023 13:12:18 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="391883948" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="391883948" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 13:12:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="766533648" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="766533648" X-Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 11 Dec 2023 13:12:17 -0800 X-Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 11 Dec 2023 13:12:16 -0800 X-Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 11 Dec 2023 13:12:16 -0800 X-Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 11 Dec 2023 13:12:16 -0800 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 11 Dec 2023 13:12:15 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KKP7rzPspA4VvzjB4yZLD6K6VqJQwYBKRBBPMo0F/ulXt+iPNeE8LzIIDCcZRGixU99drZDHDMRU3TBUU2PZwOV8npJSTvkWEfamqhZSnvIr3txGE5XkDq5pl99oYOc0HO5MIsNSxGdEYfPIcKKEwT4MnWshyH/9Eopgqg6EOQeD5eMqz6ZI9m2Z7/2NuMVoB9OHTJn5ERP3U15poJRpkB4Oq1b6zeiBSPizM4WeXfVdbYUpnFBWSwLOEDKv7hMo2n31ropdRmWhbdTUgCyMenEaortdnVhHd45cDHGYF0b4wkXX4T7zNf0RyT63Ch7Wqrj0y3iJW74dfhVskK064g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SMrOGxnhRcHiZdXgZ+32SzIrC2aY/NipkjrTqmz+SZw=; b=WYNbEnQPK3WbVt8/4E2JMsBcSH3fKVQM/fWxDZogYql0VtlO7meaWey5i9QVnLjZpEtLwMoFnOoEjpg6R+vZZsahUQCyGlhi4OCdO83/PzciSRZhkOJiKiRq0W7Dd9Y1lyQ0vvD2B3BExQ3/nrPUd6oljWYsW4m+ta4rsed5YG9ENmnbf6ntI0jG3bQY3JSwPwyTj35skO18ud1+dO2U1tsD6WIT4QRTJeqoq68Nurx70pQZPfw37slQ6rIUDUdcrwMb/szQ14/Rc1V/dmaDou6U+ZbmZsdn32qJDdIS8ZXzoZUNArQCJj3jWvLFSdzqaXsMLAcEkazLfn4pjngHGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com (2603:10b6:303:6d::19) by DM4PR11MB7254.namprd11.prod.outlook.com (2603:10b6:8:10e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 21:12:02 +0000 X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::4382:5b03:f13:88ff]) by CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::4382:5b03:f13:88ff%4]) with mapi id 15.20.7068.031; Mon, 11 Dec 2023 21:12:02 +0000 From: "Michael D Kinney" To: "Tan, Dun" , "devel@edk2.groups.io" CC: "Gao, Liming" , "Liu, Zhiguang" , "Ni, Ray" , "Kinney, Michael D" Subject: Re: [edk2-devel] [PATCH 2/2] MdePkg:simplify Fifo API in BaseIoLibIntrinsic Thread-Topic: [edk2-devel] [PATCH 2/2] MdePkg:simplify Fifo API in BaseIoLibIntrinsic Thread-Index: AQHaKCY7AI+ioMHw7kK4mObbiBsT2LCkYAEggAA9BRA= Date: Mon, 11 Dec 2023 21:12:02 +0000 Message-ID: References: <20231109024958.1732-1-dun.tan@intel.com> <1795D4A7D7819C64.15940@groups.io> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO1PR11MB4929:EE_|DM4PR11MB7254:EE_ x-ms-office365-filtering-correlation-id: 82aabfe9-1487-4c15-0c78-08dbfa8dd238 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: BWyimqbeTK25sTiNJ4e17RkSIX7nQSGGgF8bx6S6xL+w9V023E1F41DdLAClsJjbOCEd+awkcjnPkTS/k5TZkY2j38bO5oiIZnOsMyPzEmVH/JsO1ET2A8BljWZM+u2i8H5Xqo9acD0FXKGHxnIeS7Iht9uX+BDGVyDPsA/HTRyHh6wpUBpWVKDiCzW5OEj/+NU0koniNUZzoTD07gwgUfcCqvWNX8JilUBQmCM1AFR26LjvUCrAlbOyNoRlM5BwzfeH2fMrk4591KoAGKayqmbzhWnH2i1doy0pBNJXKx17rK2j7xLniUhUxsF4p2HfH/GCvOtK3KFr0T5u/gAJH7kJbF+7VoiY9nX2mUixz041Y5XeM8YRh3JXgb89xONpZYDbhM7FBvNk2oZHmWywpGHJE8HFoDDcsGXjz4o894C5j3VveV/l8FfkRkKYkXGUnLguXeLEbeYCyAhh9Wt5l7T0otRAlaNxY3XJsQVwCNzxkmsSnZeHuxBB3VTHNTUjV5SVoJXtWEuYlREMVfXQB4kXdsf82SZ4eEwL6M5Y2mjugcpN48Ykuwu1kPretNRKwsiLr8J6opCKjaovaRwm09RffgBW3ADLFfLZjJXCGCywYszjckQS/MyCHVtcVX+n49kKw4L0+V8bD32uglaqfg== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?XpEi3k/72nFuOvp0F86WlvAJY3YfP9Yk0YI99jo93OmmoOLam48W+F9WwW9e?= =?us-ascii?Q?0XTs791dfB993I8ONOH6+LvPwK5i9TH7VwUYMLkA6THkTbUZ09E7AT2ZHmCF?= =?us-ascii?Q?9ulIOPjywpyzruEPouFNZnRpsjfO7prChEU5aqzUTIslsPGmxMsC8IfR1Q3E?= =?us-ascii?Q?LnVuZtKagvwEGqzcSvaKjUFEUAvvX5BAK3w836xAzqiJhm6pGYClhjKlcUNH?= =?us-ascii?Q?WKrqSNxVdCyuJQLnpAjYZ5mR1EYAOY7ikU6YmFbsBlFsTvCrWASjZTnvR5wD?= =?us-ascii?Q?hVdHV7dxulOFjlE6wT6ulTr3N2X1wVO4jmiPqNw+G6A4mQb9T6/lGAMgWVgi?= =?us-ascii?Q?4ZVU3dcB2e+dEj6gt+AQoswyvJEum1K7K1YllGOZ+PQvaRLNEgEx7RAMrTcW?= =?us-ascii?Q?UTTZ3canAFHWzXHersOOozYp8yupPaXcnHh7s3Z37O3QPmSVWKy4GEKxlHC9?= =?us-ascii?Q?mEz/9WxHq8jhUyJwv0gK4BpUS3QC45DA66VF280e80aSRW+3Xcb3TZm3b6KI?= =?us-ascii?Q?iK9mPjsOZuCTCFqEoMWV7QeboQTvcpI231e3tNenn1OAgzTEZJVq/w6hcFsj?= =?us-ascii?Q?oAecy67qTmoLnnozZXOzlWMXAmTDJUQit1kscU4+xL7ERwa61MoswRfVIsvE?= =?us-ascii?Q?gjeqhXIhfpJsSnwPmMIeLgv1Mysz+H5WFW6fNhECsr7hnPPrEpioEr39a65M?= =?us-ascii?Q?QOnG0/D5cBjeo9ZHS+zV4w5AzxH83gFMG+DSOk9KGVyqP+JzfvDdgnpCmcTB?= =?us-ascii?Q?5cSckisGT1qPi0uXR/kxQgUx4jwam8X5CX0eE4SCNxmQLHDZtg2NurPfFKUE?= =?us-ascii?Q?Gw4anJ+IEO81gOFPgW5GYtjmuJQU7jhJaFoWtADqoMJc81UVbwFdRnIOSS45?= =?us-ascii?Q?r9zR9pfZclmmTFk5Yoc/aCda46gEDWwrW1MUoutRhhFWFEnu6D/6D7gJDKF1?= =?us-ascii?Q?n31Bi0a5oRXYLa5UCS/B1m40aJ1R8loHqlc4wdDAeUwmQuehVnHFE/Jo/EOV?= =?us-ascii?Q?n0/FVJJd47OmOwLq932T8iwlVBs5mW9r+GSJIBXOoJUa5ioiT7jf9PIaUC2a?= =?us-ascii?Q?+oXMW7furYJB9pkMLPK+C4X9w5X2lFEKVAAnUT8G4ogzFluhOFdDD4Lp+k/K?= =?us-ascii?Q?5mYRmxZrwhSA3bDUIMG0hjik3WLnhaAwrvAqN/kQUqs7ZQBVdlT05fl4sqJ9?= =?us-ascii?Q?YfLWI2LUgg5eEbwA6Y6h1z4+1oEbfk/Bq7tmhpxB+YHNs26isQx/SiQ4EaxI?= =?us-ascii?Q?I4JMcLyVGrm+qvMui4DifZMYnUy2ZP8ydavhhd3lreCoK3ac5pLLlK8n3nZ5?= =?us-ascii?Q?CukN+FLL/k/Px1LmKcxFND+HvfhInqxlwc7tSndpZ9YhOMFb0LdA9gAOAeit?= =?us-ascii?Q?Hv55qYkMDsbacrUnlg7haHXFsjj30eSKKaUisVWpTzoagZrJkjzU/ksDY2me?= =?us-ascii?Q?K7NeSoKROVWf2zbxJDkLRWtHDICxyLsbF3fy4Q5dZayUnDUFgEAXJGis4pRi?= =?us-ascii?Q?KnHjcVS0PBmUO2Ih4yWzohUZRbA8JARPetLSaqzBZ7tBOg831+MVunJvHjkR?= =?us-ascii?Q?AcSDO/un8N8RUbkmh4UcgnWTGFCoakt9NN/uTLnm?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4929.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82aabfe9-1487-4c15-0c78-08dbfa8dd238 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2023 21:12:02.6692 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: RS5Ld7ui3Va+SCMdto8OxZSA8YshkCQu4rVw3z8duHPAZrH63rSbzFzPAQCXNhzsfkP5iz1yAE8svcrHu4LirMJ/JHAyQYyk9ELQ9ARTcLk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB7254 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: N5DfodCM4i7mHegNPh2fPc3Nx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=nQL22ZQU; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Merged: https://github.com/tianocore/edk2/pull/5138 > -----Original Message----- > From: Kinney, Michael D > Sent: Monday, December 11, 2023 9:34 AM > To: Tan, Dun ; devel@edk2.groups.io > Cc: Gao, Liming ; Liu, Zhiguang > ; Ni, Ray ; Kinney, Michael D > > Subject: RE: [edk2-devel] [PATCH 2/2] MdePkg:simplify Fifo API in > BaseIoLibIntrinsic >=20 > Acked-by: Michael D Kinney >=20 > Mike >=20 > > -----Original Message----- > > From: Tan, Dun > > Sent: Wednesday, December 6, 2023 1:26 AM > > To: devel@edk2.groups.io; Tan, Dun > > Cc: Kinney, Michael D ; Gao, Liming > > ; Liu, Zhiguang ; > Ni, > > Ray > > Subject: RE: [edk2-devel] [PATCH 2/2] MdePkg:simplify Fifo API in > > BaseIoLibIntrinsic > > > > Hi Mike and Liming, > > > > Could you please help to review this patch? > > > > Thanks, > > Dun > > > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of duntan > > Sent: Thursday, November 9, 2023 10:50 AM > > To: devel@edk2.groups.io > > Cc: Kinney, Michael D ; Gao, Liming > > ; Liu, Zhiguang ; > Ni, > > Ray > > Subject: [edk2-devel] [PATCH 2/2] MdePkg:simplify Fifo API in > > BaseIoLibIntrinsic > > > > Simplify IoRead/WriteFifo implement by repeatedly calling IoRead/Write > > in the C code. > > This can avoid calling assembly code to use string I/O instructions. > > With this change Ia32/IoFifo.nasm and X64/IoFifo.nasm can be removed. > > Then the source files for IA32 and X64 are the same. > > > > Signed-off-by: Dun Tan > > Cc: Michael D Kinney > > Cc: Liming Gao > > Cc: Zhiguang Liu > > Cc: Ray Ni > > --- > > MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf | 10 ++---- > -- > > -- > > MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm | 131 ------ > -- > > ---------------------------------------------------------------------- > -- > > --------------------------------------------------- > > MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c | 220 > > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > ++++ > > MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm | 120 ------ > -- > > ---------------------------------------------------------------------- > -- > > ---------------------------------------- > > 4 files changed, 222 insertions(+), 259 deletions(-) > > > > diff --git a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf > > b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf > > index aeb072ee95..b587e2cded 100644 > > --- a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf > > +++ b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf > > @@ -38,17 +38,11 @@ > > IoLibInternalTdxNull.c > > IoLibTdx.h > > > > -[Sources.IA32] > > +[Sources.IA32, Sources.X64] > > IoLibGcc.c | GCC > > IoLibMsc.c | MSFT > > IoLib.c > > - Ia32/IoFifo.nasm > > - > > -[Sources.X64] > > - IoLibGcc.c | GCC > > - IoLibMsc.c | MSFT > > - IoLib.c > > - X64/IoFifo.nasm > > + IoLibFifo.c > > > > [Sources.EBC] > > IoLibEbc.c > > diff --git a/MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm > > b/MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm > > deleted file mode 100644 > > index a4ae1a0053..0000000000 > > --- a/MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm > > +++ /dev/null > > @@ -1,131 +0,0 @@ > > -;-------------------------------------------------------------------- > -- > > -------- > > -; > > -; Copyright (c) 2006 - 2012, Intel Corporation. All rights > > reserved.
-; Copyright (c) 2017, AMD Incorporated. All rights > > reserved.
-; -; SPDX-License-Identifier: BSD-2-Clause-Patent -; > > -;-------------------------------------------------------------------- > -- > > -------- > > - > > - SECTION .text > > - > > -;-------------------------------------------------------------------- > -- > > -------- > > -; VOID > > -; EFIAPI > > -; IoReadFifo8 ( > > -; IN UINTN Port, > > -; IN UINTN Size, > > -; OUT 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, > > -; OUT 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, > > -; OUT 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/MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c > > b/MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c > > new file mode 100644 > > index 0000000000..bd1d372d0f > > --- /dev/null > > +++ b/MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c > > @@ -0,0 +1,220 @@ > > +/** @file > > + IoFifo read/write routines. > > + > > + Copyright (c) 2021 - 2023, Intel Corporation. All rights > > + reserved.
> > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > +**/ > > + > > +#include "BaseIoLibIntrinsicInternal.h" > > +#include > > + > > +/** > > + 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(). > > + > > + In TDX a serial of TdIoRead8 is invoked to read the I/O port fifo. > > + > > + @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 > > + ) > > +{ > > + UINT8 *Buffer8; > > + > > + Buffer8 =3D (UINT8 *)Buffer; > > + while (Count-- > 0) { > > + *Buffer8++ =3D IoRead8 (Port); > > + } > > +} > > + > > +/** > > + 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(). > > + > > + In TDX a serial of TdIoWrite8 is invoked to write data to the I/O > > port. > > + > > + @param Port The I/O port to write. > > + @param Count The number of times to write I/O port. > > + @param Buffer The buffer to retrieve the write data from. > > + > > +**/ > > +VOID > > +EFIAPI > > +IoWriteFifo8 ( > > + IN UINTN Port, > > + IN UINTN Count, > > + IN VOID *Buffer > > + ) > > +{ > > + UINT8 *Buffer8; > > + > > + Buffer8 =3D (UINT8 *)Buffer; > > + while (Count-- > 0) { > > + IoWrite8 (Port, *Buffer8++); > > + } > > +} > > + > > +/** > > + 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(). > > + > > + In TDX a serial of TdIoRead16 is invoked to read data from the I/O > > port. > > + > > + @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 > > + ) > > +{ > > + UINT16 *Buffer16; > > + > > + Buffer16 =3D (UINT16 *)Buffer; > > + while (Count-- > 0) { > > + *Buffer16++ =3D IoRead16 (Port); > > + } > > +} > > + > > +/** > > + 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(). > > + > > + In TDX a serial of TdIoWrite16 is invoked to write data to the I/O > > port. > > + > > + @param Port The I/O port to write. > > + @param Count The number of times to write I/O port. > > + @param Buffer The buffer to retrieve the write data from. > > + > > +**/ > > +VOID > > +EFIAPI > > +IoWriteFifo16 ( > > + IN UINTN Port, > > + IN UINTN Count, > > + IN VOID *Buffer > > + ) > > +{ > > + UINT16 *Buffer16; > > + > > + Buffer16 =3D (UINT16 *)Buffer; > > + while (Count-- > 0) { > > + IoWrite16 (Port, *Buffer16++); > > + } > > +} > > + > > +/** > > + 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(). > > + > > + In TDX a serial of TdIoRead32 is invoked to read data from the I/O > > port. > > + > > + @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 > > + ) > > +{ > > + UINT32 *Buffer32; > > + > > + Buffer32 =3D (UINT32 *)Buffer; > > + while (Count-- > 0) { > > + *Buffer32++ =3D IoRead32 (Port); > > + } > > +} > > + > > +/** > > + 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(). > > + > > + In TDX a serial of TdIoWrite32 is invoked to write data to the I/O > > port. > > + > > + @param Port The I/O port to write. > > + @param Count The number of times to write I/O port. > > + @param Buffer The buffer to retrieve the write data from. > > + > > +**/ > > +VOID > > +EFIAPI > > +IoWriteFifo32 ( > > + IN UINTN Port, > > + IN UINTN Count, > > + IN VOID *Buffer > > + ) > > +{ > > + UINT32 *Buffer32; > > + > > + Buffer32 =3D (UINT32 *)Buffer; > > + while (Count-- > 0) { > > + IoWrite32 (Port, *Buffer32++); > > + } > > +} > > diff --git a/MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm > > b/MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm > > deleted file mode 100644 > > index d459072f6e..0000000000 > > --- a/MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm > > +++ /dev/null > > @@ -1,120 +0,0 @@ > > -;-------------------------------------------------------------------- > -- > > -------- > > -; > > -; Copyright (c) 2006 - 2012, Intel Corporation. All rights > > reserved.
-; Copyright (c) 2017, AMD Incorporated. All rights > > reserved.
-; -; SPDX-License-Identifier: BSD-2-Clause-Patent -; > > -;-------------------------------------------------------------------- > -- > > -------- > > - > > - DEFAULT REL > > - SECTION .text > > - > > -;-------------------------------------------------------------------- > -- > > -------- > > -; VOID > > -; EFIAPI > > -; IoReadFifo8 ( > > -; IN UINTN Port, // rcx > > -; IN UINTN Size, // rdx > > -; OUT 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 > > -; OUT 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 > > -; OUT 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 > > - > > -- > > 2.31.1.windows.1 > > > > > > > >=20 > > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112327): https://edk2.groups.io/g/devel/message/112327 Mute This Topic: https://groups.io/mt/103009916/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-