From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=01703bcc39=abner.chang@hpe.com) Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by groups.io with SMTP; Mon, 23 Sep 2019 18:55:14 -0700 Received: from pps.filterd (m0134423.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8O1qPEd003608 for ; Tue, 24 Sep 2019 01:55:13 GMT Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) by mx0b-002e3701.pphosted.com with ESMTP id 2v6vj647ru-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 24 Sep 2019 01:55:13 +0000 Received: from G1W8106.americas.hpqcorp.net (g1w8106.austin.hp.com [16.193.72.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3426.houston.hpe.com (Postfix) with ESMTPS id 64F8F60 for ; Tue, 24 Sep 2019 01:55:12 +0000 (UTC) Received: from G4W9329.americas.hpqcorp.net (16.208.32.99) by G1W8106.americas.hpqcorp.net (16.193.72.61) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 24 Sep 2019 01:54:51 +0000 Received: from G2W6311.americas.hpqcorp.net (16.197.64.53) by G4W9329.americas.hpqcorp.net (16.208.32.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 24 Sep 2019 01:54:51 +0000 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (15.241.52.10) by G2W6311.americas.hpqcorp.net (16.197.64.53) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 24 Sep 2019 01:54:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kywC49ieqS636hD0ZBLjV5uASQFeZ5kmx4Mi9xtt+Khj4FrbELC4Cc5NSw/qHT4HruC+suMb5SFeAinvf/LaHgt19RR384ZMgn8dHojQWYQk1HcnRRs9Hb9Ey++D6hYM8Wc6ksb8kla3DEfAHj4hCsR395259xHw5rQ3ovo2Br/2+HbRfEV2OWzFeSGUC4HiUw0Vi8rfjaQpscGik6ecXQ3aHzHHIFWshCXzB+ZUKOtlrvl5z7mz5a4ly30ehCVtS7TUnHn4Rdn+Q+hB0tBR9getxf3iBE79Y+r7FF1t7mOjchw0uQuqgjmikVvg6Svo3d4bdBzP08oo3+5RuEnCoA== 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-SenderADCheck; bh=Azuazjqh0y7Yja8n0x4cyNkUqrGFDb3Pvu95ZFnFYxw=; b=KWw3/bupNZOZMRZtH9Vtjeon1TR/X85w3hIMqwUI8svOZnqhSfF+4x9bKNOKPdpO1kCTsgd0DPKSi+1C65qz3XZhvPvIME/15gmusUjDlI2sjQU59McW3M4TKkUxiPQOlxBWVeS4SyUbyrPDvCuka/JABdlS51bP6GbUpxMCM80EnDAR6dYsB3x1La38NTq5K1unSJninnPSsojcgEQ0J3+Liz+G6zqAQ2pygb20JOEue1SDECuIrBde+6J+j2KcLOCSXZwebQ24trD1/YmyWhk1uu4KgezfzJMOIgUo+xn60Jxk7a1dLKqot8cze4+gC+Hcq6ItSFJJVqHbo6cKgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Received: from CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM (10.169.12.151) by CS1PR8401MB0983.NAMPRD84.PROD.OUTLOOK.COM (10.169.16.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2284.26; Tue, 24 Sep 2019 01:54:28 +0000 Received: from CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM ([fe80::4fb:84b9:76e6:1cde]) by CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM ([fe80::4fb:84b9:76e6:1cde%8]) with mapi id 15.20.2284.023; Tue, 24 Sep 2019 01:54:28 +0000 From: "Abner Chang" To: "devel@edk2.groups.io" , "Chang, Abner (HPS SW/FW Technologist)" CC: Liming Gao , Michael D Kinney Subject: Re: [edk2-devel] [edk2-staging/RISC-V-V2 PATCH v2 09/29] MdePkg/BaseIoLibIntrinsic: RISC-V I/O intrinsic functions. Thread-Topic: [edk2-devel] [edk2-staging/RISC-V-V2 PATCH v2 09/29] MdePkg/BaseIoLibIntrinsic: RISC-V I/O intrinsic functions. Thread-Index: AQHVcaqnCN/VVV7a70S7+mDnGCY4+Kc6Epmg Date: Tue, 24 Sep 2019 01:54:28 +0000 Message-ID: References: <1569198715-31552-1-git-send-email-abner.chang@hpe.com> <15C6EB9A049FF8A4.24160@groups.io> In-Reply-To: <15C6EB9A049FF8A4.24160@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [16.242.247.131] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 85918dec-8f5a-4a5e-ac78-08d740922290 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600167)(711020)(4605104)(1401327)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020);SRVR:CS1PR8401MB0983; x-ms-traffictypediagnostic: CS1PR8401MB0983: x-ms-exchange-purlcount: 2 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3276; x-forefront-prvs: 0170DAF08C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6029001)(376002)(366004)(396003)(136003)(39860400002)(346002)(199004)(189003)(13464003)(2906002)(71200400001)(9686003)(71190400001)(30864003)(229853002)(52536014)(110136005)(99286004)(14454004)(316002)(66066001)(478600001)(5660300002)(966005)(256004)(86362001)(6116002)(26005)(6246003)(4326008)(74316002)(102836004)(54906003)(25786009)(8936002)(81156014)(486006)(476003)(81166006)(16799955002)(33656002)(66556008)(446003)(6436002)(11346002)(8676002)(305945005)(66946007)(3846002)(2501003)(76176011)(6306002)(19627235002)(7696005)(76116006)(66476007)(7736002)(53546011)(6506007)(55016002)(186003)(64756008)(66446008)(579004);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR8401MB0983;H:CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: t91XB01BoVO85jygb02ocP56macW9K8/vcH8DDgcxCaxQZSRx6F5qrzeTG0fj4Y9a8F27sqzwSRS7tPcoDCrk1gJvc9S1gCEtEleQNRaVYfpM3Gk++CHz62OVM8qEf4WfzVwLaI0HiPcUTlrBR6+ZYE979UI4fwqDlOBDI9ckIvglglNHADxTsxAd/DWfZlLZEd0n/R+LP33YDciBklTgVPofbzJt2X4IRezyk0/NMU82o0Bsu6jtL8Qaq/8SVtAXwSCFtefqHcF8FcK80DbTaxg/kA5BU6JVl95Vu6tAfQ+agrgnodTj97GufM9kH80A+bC2F3KAzFWMEH0V8Us88sfi1OIR9Py8xKiNYhA7+NeiJPbQJKQowEDSCwInAdcECNVqBc/rAgamlhtm/egfuWLasyqDtZMnk1CsZZQF1E= X-MS-Exchange-CrossTenant-Network-Message-Id: 85918dec-8f5a-4a5e-ac78-08d740922290 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Sep 2019 01:54:28.3724 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: iOFBZ1yud02tXlI0c9sdPDf1zMAfW6jXBzKkIvGEX/BooejooUWselcU5Lq5VBeGmUirXJEaTVfojiJ6kE0ppA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR8401MB0983 X-OriginatorOrg: hpe.com X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-09-23_10:2019-09-23,2019-09-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 suspectscore=0 bulkscore=0 clxscore=1015 mlxscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1909240017 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable CC Maintainers. > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Abner Chang > Sent: Monday, September 23, 2019 8:32 AM > To: devel@edk2.groups.io > Cc: Chang, Abner (HPS SW/FW Technologist) > Subject: [edk2-devel] [edk2-staging/RISC-V-V2 PATCH v2 09/29] > MdePkg/BaseIoLibIntrinsic: RISC-V I/O intrinsic functions. >=20 > RISC-V MMIO library instance. RISC-V only supports memory map I/O. >=20 > Signed-off-by: Abner Chang > --- > .../BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf | 8 +- > MdePkg/Library/BaseIoLibIntrinsic/IoLibRiscV.c | 601 > +++++++++++++++++++++ > 2 files changed, 607 insertions(+), 2 deletions(-) create mode 100644 > MdePkg/Library/BaseIoLibIntrinsic/IoLibRiscV.c >=20 > diff --git a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf > b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf > index 457cce9..fbb568e 100644 > --- a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf > +++ b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf > @@ -2,13 +2,14 @@ > # Instance of I/O Library using compiler intrinsics. > # > # I/O Library that uses compiler intrinsics to perform IN and OUT inst= ructions > -# for IA-32 and x64. On IPF, I/O port requests are translated into MM= IO > requests. > +# for IA-32, x64 and RISC-V. On IPF, I/O port requests are translated= into > MMIO requests. > # MMIO requests are forwarded directly to memory. For EBC, I/O port > requests # ASSERT(). > # > # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved. # > Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
= # > Copyright (c) 2017, AMD Incorporated. All rights reserved.
> +# Portinos Copyright (c) 2016, Hewlett Packard Enterprise Development > +LP. All rights reserved.
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -25,7 +26,7 @@ >=20 >=20 > # > -# VALID_ARCHITECTURES =3D IA32 X64 EBC ARM AARCH64 > +# VALID_ARCHITECTURES =3D IA32 X64 EBC ARM AARCH64 RISCV64 > # >=20 > [Sources] > @@ -55,6 +56,9 @@ > [Sources.AARCH64] > IoLibArm.c >=20 > +[Sources.RISCV64] > + IoLibRiscV.c > + > [Packages] > MdePkg/MdePkg.dec >=20 > diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLibRiscV.c > b/MdePkg/Library/BaseIoLibIntrinsic/IoLibRiscV.c > new file mode 100644 > index 0000000..789928b > --- /dev/null > +++ b/MdePkg/Library/BaseIoLibIntrinsic/IoLibRiscV.c > @@ -0,0 +1,601 @@ > +/** @file > + Common I/O Library routines for RISC-V > + > + Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. > + 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 > + INVALID URI REMOVED > 3A__opensource.org_lic > + enses_bsd- > 2Dlicense.php&d=3DDwIBAg&c=3DC5b8zRQO1miGmBeVZ2LFWg&r=3D_SN6FZBN4V > + > gi4Ulkskz6qU3NYRO03nHp9P7Z5q59A3E&m=3DiiSSnOQeIcsWwWSNpZOq8Z8FU > hf-ZXBIKZ > + -k2RKjtSw&s=3DJXcajsH1FkirFiWOe0VJ0qh1HCibFZd6W9j87D8J98k&e=3D > + > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > BASIS, > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER > EXPRESS OR IMPLIED. > +**/ > + > +#include "BaseIoLibIntrinsicInternal.h" > + > +/** > + Reads an 8-bit MMIO register. > + > + Reads the 8-bit MMIO register specified by Address. The 8-bit read > + value is returned. This function must guarantee that all MMIO read > + and write operations are serialized. > + > + If 8-bit MMIO register operations are not supported, then ASSERT(). > + > + @param Address The MMIO register to read. > + > + @return The value read. > + > +**/ > +UINT8 > +EFIAPI > +MmioRead8 ( > + IN UINTN Address > + ) > +{ > + return *(volatile UINT8*)Address; > +} > + > +/** > + Writes an 8-bit MMIO register. > + > + Writes the 8-bit MMIO register specified by Address with the value > + specified by Value and returns Value. This function must guarantee > + that all MMIO read and write operations are serialized. > + > + If 8-bit MMIO register operations are not supported, then ASSERT(). > + > + @param Address The MMIO register to write. > + @param Value The value to write to the MMIO register. > + > + @return Value. > + > +**/ > +UINT8 > +EFIAPI > +MmioWrite8 ( > + IN UINTN Address, > + IN UINT8 Value > + ) > +{ > + *(volatile UINT8 *)Address =3D Value; > + return Value; > +} > + > +/** > + Reads a 16-bit MMIO register. > + > + Reads the 16-bit MMIO register specified by Address. The 16-bit read > + value is returned. This function must guarantee that all MMIO read > + and write operations are serialized. > + > + If 16-bit MMIO register operations are not supported, then ASSERT(). > + If Address is not aligned on a 16-bit boundary, then ASSERT(). > + > + @param Address The MMIO register to read. > + > + @return The value read. > + > +**/ > +UINT16 > +EFIAPI > +MmioRead16 ( > + IN UINTN Address > + ) > +{ > + return *(volatile UINT16 *)Address; > +} > + > +/** > + Writes a 16-bit MMIO register. > + > + Writes the 16-bit MMIO register specified by Address with the value > + specified by Value and returns Value. This function must guarantee > + that all MMIO read and write operations are serialized. > + > + If 16-bit MMIO register operations are not supported, then ASSERT(). > + If Address is not aligned on a 16-bit boundary, then ASSERT(). > + > + @param Address The MMIO register to write. > + @param Value The value to write to the MMIO register. > + > + @return Value. > + > +**/ > +UINT16 > +EFIAPI > +MmioWrite16 ( > + IN UINTN Address, > + IN UINT16 Value > + ) > +{ > + *(volatile UINT16 *)Address =3D Value; > + return Value; > +} > + > +/** > + Reads a 32-bit MMIO register. > + > + Reads the 32-bit MMIO register specified by Address. The 32-bit read > + value is returned. This function must guarantee that all MMIO read > + and write operations are serialized. > + > + If 32-bit MMIO register operations are not supported, then ASSERT(). > + If Address is not aligned on a 32-bit boundary, then ASSERT(). > + > + @param Address The MMIO register to read. > + > + @return The value read. > + > +**/ > +UINT32 > +EFIAPI > +MmioRead32 ( > + IN UINTN Address > + ) > +{ > + return *(volatile UINT32 *)Address; > +} > + > +/** > + Writes a 32-bit MMIO register. > + > + Writes the 32-bit MMIO register specified by Address with the value > + specified by Value and returns Value. This function must guarantee > + that all MMIO read and write operations are serialized. > + > + If 32-bit MMIO register operations are not supported, then ASSERT(). > + If Address is not aligned on a 32-bit boundary, then ASSERT(). > + > + @param Address The MMIO register to write. > + @param Value The valu return *(volatile UINT8*)Address; > + to write to the MMIO register. > + > + @return Value. > + > +**/ > +UINT32 > +EFIAPI > +MmioWrite32 ( > + IN UINTN Address, > + IN UINT32 Value > + ) > +{ > + *(volatile UINT32 *)Address =3D Value; > + return Value; > +} > + > +/** > + Reads a 64-bit MMIO register. > + > + Reads the 64-bit MMIO register specified by Address. The 64-bit read > + value is returned. This function must guarantee that all MMIO read > + and write operations are serialized. > + > + If 64-bit MMIO register operations are not supported, then ASSERT(). > + If Address is not aligned on a 64-bit boundary, then ASSERT(). > + > + @param Address The MMIO register to read. > + > + @return The value read. > + > +**/ > +UINT64 > +EFIAPI > +MmioRead64 ( > + IN UINTN Address > + ) > +{ > + return *(volatile UINT64 *)Address; > +} > + > +/** > + Writes a 64-bit MMIO register. > + > + Writes the 64-bit MMIO register specified by Address with the value > + specified by Value and returns Value. This function must guarantee > + that all MMIO read and write operations are serialized. > + > + If 64-bit MMIO register operations are not supported, then ASSERT(). > + If Address is not aligned on a 64-bit boundary, then ASSERT(). > + > + @param Address The MMIO register to write. > + @param Value The value to write to the MMIO register. > + > +**/ > +UINT64 > +EFIAPI > +MmioWrite64 ( > + IN UINTN Address, > + IN UINT64 Value > + ) > +{ > + *(volatile UINT64 *)Address =3D Value; > + return Value; > +} > + > +/** > + Reads an 8-bit I/O port. > + > + Reads the 8-bit I/O port specified by Port. The 8-bit read value is r= eturned. > + 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. > + > + @return The value read. > + > +**/ > +UINT8 > +EFIAPI > +IoRead8 ( > + IN UINTN Port > + ) > +{ > + DEBUG((DEBUG_ERROR, "%a:RISC-V unsupportted function.\n", > +__FUNCTION__)); > + ASSERT (FALSE); > + return 0; > +} > + > +/** > + Writes an 8-bit I/O port. > + > + Writes the 8-bit I/O port specified by Port with the value specified > + by Value and returns Value. 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 write. > + @param Value The value to write to the I/O port. > + > + @return The value written the I/O port. > + > +**/ > + > +UINT8 > +EFIAPI > +IoWrite8 ( > + IN UINTN Port, > + IN UINT8 Value > + ) > +{ > + DEBUG((DEBUG_ERROR, "%a:RISC-V unsupportted function.\n", > +__FUNCTION__)); > + ASSERT (FALSE); > + return 0; > +} > + > +/** > + Reads a 16-bit I/O port. > + > + Reads the 16-bit I/O port specified by Port. The 16-bit read value is > returned. > + 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. > + > + @return The value read. > + > +**/ > +UINT16 > +EFIAPI > +IoRead16 ( > + IN UINTN Port > + ) > +{ > + DEBUG((DEBUG_ERROR, "%a:RISC-V unsupportted function.\n", > +__FUNCTION__)); > + ASSERT (FALSE); > + return 0; > +} > + > +/** > + Writes a 16-bit I/O port. > + > + Writes the 16-bit I/O port specified by Port with the value specified > + by Value and returns Value. 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 write. > + @param Value The value to write to the I/O port. > + > + @return The value written the I/O port. > + > +**/ > +UINT16 > +EFIAPI > +IoWrite16 ( > + IN UINTN Port, > + IN UINT16 Value > + ) > +{ > + DEBUG((DEBUG_ERROR, "%a:RISC-V unsupportted function.\n", > +__FUNCTION__)); > + ASSERT (FALSE); > + return 0; > +} > + > +/** > + Reads a 32-bit I/O port. > + > + Reads the 32-bit I/O port specified by Port. The 32-bit read value is > returned. > + 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. > + > + @return The value read. > + > +**/ > +UINT32 > +EFIAPI > +IoRead32 ( > + IN UINTN Port > + ) > +{ > + DEBUG((DEBUG_ERROR, "%a:RISC-V unsupportted function.\n", > +__FUNCTION__)); > + ASSERT (FALSE); > + return 0; > +} > + > +/** > + Writes a 32-bit I/O port. > + > + Writes the 32-bit I/O port specified by Port with the value specified > + by Value and returns Value. 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 write. > + @param Value The value to write to the I/O port. > + > + @return The value written the I/O port. > + > +**/ > +UINT32 > +EFIAPI > +IoWrite32 ( > + IN UINTN Port, > + IN UINT32 Value > + ) > +{ > + DEBUG((DEBUG_ERROR, "%a:RISC-V unsupportted function.\n", > +__FUNCTION__)); > + ASSERT (FALSE); > + return 0; > +} > + > +/** > + Reads a 64-bit I/O port. > + > + Reads the 64-bit I/O port specified by Port. The 64-bit read value is > returned. > + This function must guarantee that all I/O read and write operations > + are serialized. > + > + If 64-bit I/O port operations are not supported, then ASSERT(). > + If Port is not aligned on a 64-bit boundary, then ASSERT(). > + > + @param Port The I/O port to read. > + > + @return The value read. > + > +**/ > +UINT64 > +EFIAPI > +IoRead64 ( > + IN UINTN Port > + ) > +{ > + DEBUG((DEBUG_ERROR, "%a:RISC-V unsupportted function.\n", > +__FUNCTION__)); > + ASSERT (FALSE); > + return 0; > +} > + > +/** > + Writes a 64-bit I/O port. > + > + Writes the 64-bit I/O port specified by Port with the value specified > + by Value and returns Value. This function must guarantee that all I/O > + read and write operations are serialized. > + > + If 64-bit I/O port operations are not supported, then ASSERT(). > + If Port is not aligned on a 64-bit boundary, then ASSERT(). > + > + @param Port The I/O port to write. > + @param Value The value to write to the I/O port. > + > + @return The value written to the I/O port. > + > +**/ > +UINT64 > +EFIAPI > +IoWrite64 ( > + IN UINTN Port, > + IN UINT64 Value > + ) > +{ > + DEBUG((DEBUG_ERROR, "%a:RISC-V unsupportted function.\n", > +__FUNCTION__)); > + ASSERT (FALSE); > + return 0; > +} > + > +/** > + 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 > + ) > +{ > + DEBUG((DEBUG_ERROR, "%a:RISC-V unsupportted function.\n", > +__FUNCTION__)); > + ASSERT (FALSE); > +} > + > +/** > + 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 retrieve the write data from. > + > +**/ > +VOID > +EFIAPI > +IoWriteFifo8 ( > + IN UINTN Port, > + IN UINTN Count, > + IN VOID *Buffer > + ) > +{ > + DEBUG((DEBUG_ERROR, "%a:RISC-V unsupportted function.\n", > +__FUNCTION__)); > + ASSERT (FALSE); > +} > + > +/** > + 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 > + ) > +{ > + DEBUG((DEBUG_ERROR, "%a:RISC-V unsupportted function.\n", > +__FUNCTION__)); > + ASSERT (FALSE); > +} > + > +/** > + 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 retrieve the write data from. > + > +**/ > +VOID > +EFIAPI > +IoWriteFifo16 ( > + IN UINTN Port, > + IN UINTN Count, > + IN VOID *Buffer > + ) > +{ > + DEBUG((DEBUG_ERROR, "%a:RISC-V unsupportted function.\n", > +__FUNCTION__)); > + ASSERT (FALSE); > +} > + > +/** > + 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 > + ) > +{ > + DEBUG((DEBUG_ERROR, "%a:RISC-V unsupportted function.\n", > +__FUNCTION__)); > + ASSERT (FALSE); > +} > + > +/** > + 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 retrieve the write data from. > + > +**/ > +VOID > +EFIAPI > +IoWriteFifo32 ( > + IN UINTN Port, > + IN UINTN Count, > + IN VOID *Buffer > + ) > +{ > + DEBUG((DEBUG_ERROR, "%a:RISC-V unsupportted function.\n", > +__FUNCTION__)); > + ASSERT (FALSE); > +} > -- > 2.7.4 >=20 >=20 >=20