From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (NAM02-DM3-obe.outbound.protection.outlook.com [40.107.95.83]) by mx.groups.io with SMTP id smtpd.web09.8052.1665670251586817285 for ; Thu, 13 Oct 2022 07:10:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=1GGmsXbo; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.95.83, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FzyjwIZcXZ4OpGFiTsQBxS45DaeV9bHjcFyfcJjIKZBLh1lUGZhD+3Bw0vMdb8Qadmp3gsW0khlafGAVr4srMFq+4AOFU5niR6NNgswgh0Uzhlq2q4Zk2rwxbtse4unuQXmFgr4MGUW4osUaKsyVMSKF65MhYgrKkSvyHdlREQsAgVAdzGdLjlznDVglhgdklI8b+YlOLjhbg1thcK2F5uG6XdhdTURw7D7nzP1nqw6JkrOrtYmZ2BGLERCk9RrFcYARxJDgijHmKRju1sir0Gbf77jJ9vEsq36IQUIaRubunsOiK8T2tWebMruCaP/c8VPnkfT9zcnEjaP572cw3Q== 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=lOdMttFMk0bTrRaVA5ZdsKBPeXzKdnK6Nf6fy551DtA=; b=bpmS7QHcDmTPTXSRCjCMIT9//tida0z29nMtACNIvafsJABEu8RWRFTWBmIIpERiGSdL634JLR3iyyxhqBy12pS9PECe1e+XG2+0qiosBu8+Zlw8MOsrUhCDIk+vHLdlvStcSQsM24kRIvYDlRRZs9tjpUnMRMjKiGluFr79afJ0JfRpZ91CTM2TgZ+Dw083Yk5YlUKu7BQpXxBoaCeBr80pxGzbwJdEswVSmx5csKQo+48vGJ2fDXbUgnbL30y3rca30f+lAtf7IrZY0c9dRFbkkcpbXenbxNlCW+ElfWpLc1vQmdN//hc+gzC9QiUoA17eq4iT2KkLVeo+/u5Rrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lOdMttFMk0bTrRaVA5ZdsKBPeXzKdnK6Nf6fy551DtA=; b=1GGmsXbo4IP6PJv7qkt/LMaAGqbtfdGX9k69vjXZlGKm8cAz5PIfOGKdvxmut6Ek6LuAKEluC6L0o0TlIHc6ketYptRKteSra4F2t0OSx88e491WnSAJpWGCzbC0OFck/yUisWp04KCv0Hv6HLDbe5YYPhdGY73X/p/QpYRDY/E= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by SN7PR12MB7345.namprd12.prod.outlook.com (2603:10b6:806:298::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26; Thu, 13 Oct 2022 14:10:49 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::dd29:6efb:1027:cfb2]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::dd29:6efb:1027:cfb2%5]) with mapi id 15.20.5723.026; Thu, 13 Oct 2022 14:10:49 +0000 From: "Chang, Abner" To: "devel@edk2.groups.io" , "sunilvl@ventanamicro.com" CC: Michael D Kinney , Liming Gao , Zhiguang Liu , Daniel Schaefer Subject: Re: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V3 03/34] MdePkg/BaseLib: RISC-V: Add few more helper functions Thread-Topic: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V3 03/34] MdePkg/BaseLib: RISC-V: Add few more helper functions Thread-Index: AQHY3upu1zfhBpRT4EKJBi3cvMYMTq4MXAOw Date: Thu, 13 Oct 2022 14:10:49 +0000 Message-ID: References: <20221013095829.1454581-1-sunilvl@ventanamicro.com> <20221013095829.1454581-4-sunilvl@ventanamicro.com> In-Reply-To: <20221013095829.1454581-4-sunilvl@ventanamicro.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2022-10-13T14:10:45Z; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=57e146ff-ece8-4a8b-9872-da60e50a881c; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|SN7PR12MB7345:EE_ x-ms-office365-filtering-correlation-id: 2b8b99aa-ac2e-4c29-9504-08daad24bae9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: l4jl6doSEeEOzl62SlCzS8oSnIk+4aQ+05Vvlxj/vstI5uwtxmNZh7DJNtgP4gsaceBL64THphPnCBFB7+4C/Pt6lqfMe3D7/3Gimj4HM+Aiel+cIOf59IfdlwtEtOX1yHoJaNK3ePi+npUFRxVbdXWE/TiJ5kkEhCjyI100GZED++uBH/MWLx3wkPxymfZRh5wZN0v/zEMI92tZJ2jqCXLZx65zGTqabP88b22EVWEg44tjIxI1Qsf8NJKqy+MJ+nAO7BjwrNCYWcV7xvA/5N/SIVDdZLUub1i1OE0mUYBMPU9CjOZQRBbMmwvGJPYj6oq7QKVJqVniovYCzW6KUPLoAiJ5X5UaGTBreECY1GhgTjzJVqnJmkZcx96puJUldUg776cd+tYfy+gDWr3AwCj8rcWjrI6eCQlHuF8hbGSfrtiY3wBtl2W3KerSTnCD8NO92EwMScVj8Oi29VZwyCuAEtNvFC+ptzqStuFnaEcTA3AwdeVo1er14f6jy2kuooEa8R3vVzP9I5pi/qKhnolTH7Kr3iIB7Whnw/8rf8rd0SwIs4j6a0ZyYrwVuMJqSC9SqLIhoC953XrpsO2mpgVlyLbkyICpSkBAVApTfq2hxXimkuQMGsOjrhtqm6awY0SA7qgsHNyR8rlhvIiihMqkjLg5a9wByrZgtrDP6FtBDt29VZtS4zN2l8v92yMlcDlrrgsgb75zq70t57ows/6Wx+YJ6X9Gg9MwkiGs0FBICTakywa1n7EmmicC5kI6aZdzIWfwAQCFTWCeWLzwB0DLAGzDW0nd4R63d9MUesAZWMte60Mtfi7aFWhLJq5GTd/kXoJ8TMg1Jmhz07k2Zw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB3966.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(136003)(396003)(376002)(346002)(366004)(451199015)(54906003)(19627235002)(110136005)(316002)(966005)(4326008)(64756008)(66446008)(66476007)(66556008)(66946007)(76116006)(8676002)(71200400001)(66899015)(478600001)(45080400002)(52536014)(9686003)(8936002)(26005)(41300700001)(7696005)(53546011)(6506007)(186003)(5660300002)(2906002)(83380400001)(122000001)(55016003)(38070700005)(38100700002)(33656002)(86362001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?aBLMTDsWLrSdtkvJMejbXdCZgljMiNmdLmi6JfoN01ZM/ePfXUiL4oQ71bra?= =?us-ascii?Q?4LU1iqxW41lzQOQL9EvrePdLGvVPQbeqTu69XYdI/OSQrjXoCpzkNyEKq4GH?= =?us-ascii?Q?GMMYLO8j9bcGgjm7AbMxu6khpul60v9A1/pon0PmVC2QHCoz0P0sAvRPQqdk?= =?us-ascii?Q?DQo3UmM7bhqU3GhBVkp/XFOWpMuXGbWgVgwtMcMiuAAJKRl6z2tthlZZZV62?= =?us-ascii?Q?cRYmP/tQK61yn5aKNN4zVxIR9PE4VlnjT/h50CFj4skuEc8wXjSQWtj7nLLk?= =?us-ascii?Q?nx+FOIYQR1RVExvpIvs9C6zAMco3LV++K9TxoGn1faMkl9VLSj0K7vgPzUh5?= =?us-ascii?Q?zMQ1YeKgeByXcfVNPorC6UkyXTrVFPVcbIJ7qJL6ubbm4LBvHndGO1pWoPgQ?= =?us-ascii?Q?V/xIDiPFW3OdZd5LLaqMOCt2OjLfd7LjNJloX3EJ4bWYRRjnRYfcH2B3E8f3?= =?us-ascii?Q?OTdquDYxJdMyt6bSXV+CvLcHkynU+jqFl+ccFo7+V7WibAqJPZfTTFK2qdh1?= =?us-ascii?Q?F/gd6VY9XMMY0ctHSm5jfIDiru/b2a6QruLZeKx0k/nwajxbd6apJFI2ib08?= =?us-ascii?Q?Be77zSZ3N36Cs6FVr0csh+JOmVpJ1ZK7365ASuWJRf45Te0uZcTtaC20C1YV?= =?us-ascii?Q?hwGwDFzZddobEIiO5mGlaDd7/cBzYKE5XOqW33gBS29ZEXukp6t32waNqIyS?= =?us-ascii?Q?i1CFGmrrnDNcbb1O9KRwm/kPfwRiG6E4ReIvFgIuFMvnuiAE+XXwrB/izsc1?= =?us-ascii?Q?zESVhnIkvGQ6OPDLLhTmplm44uk+4dK6rGccDn8RyoCUCnk2C0RcAM7IMEcE?= =?us-ascii?Q?cWDFVZmr9xlTi41nTvvBL20QvSy4/46KvxBlbS7SAkX0UdgpGIYSN8OUKWlW?= =?us-ascii?Q?BThBdy/WL8+b1dFtAGNXoTWq8nExh7yI9UT1mcpp+wTrf8qkg/8yCf07madB?= =?us-ascii?Q?aWPk9Q8lLXzNm95DYA8zcB3urNKDrn4XeuG6D+rsly61vZEoNu4VHknJXwgy?= =?us-ascii?Q?ipPCGWqaws5Rgu081zFUL1HM0eeIgEqvMVyYOL4/qp/XQdIzfsQKphlmEEyp?= =?us-ascii?Q?a06AtZ9hdUbW4puvpro/+gE9TBo52mUpALGwvjVhv3QuStUHqcthUAa3dg+h?= =?us-ascii?Q?AGfnl5PwyqqhpaIystkgues1cJM54xqMpucb8u/cs6Mys2LoV8y7iv0lAWwa?= =?us-ascii?Q?QtPig/+a6cIvBw+pooinGMM/m6tu15FdpF+JLRCmHRt1V1IKs0NuO9fzTkgD?= =?us-ascii?Q?zS4jLkl6TI6kdG2xkjIUATs7f2oQZmrxYpzJgfnG8VkjAbEWwOJRoiPXR+ah?= =?us-ascii?Q?N98iE1qH4j7vGxW3qqBaMWpoJFZASmcYnBQJEFiAI24JGYl2SO7DHk1KsJsV?= =?us-ascii?Q?rH6o3OMt/nwmcGW9Ixy0+w3KmR7ABz8DimCimPcz6cNkGTln13MI7Z06Lx/d?= =?us-ascii?Q?nKN7TwOq1p8U16F1X5E/5RdWdyhMgTt8rBhavsep+wPd5BvB8Ee8ZiJBD/Ew?= =?us-ascii?Q?kexqCMQljnxjurwtaF9h1cRthpXWGNTxBRvSZypcANHsbiXgtu/LduB20k+A?= =?us-ascii?Q?SSdMlg2zcHtSE+dNoPc=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b8b99aa-ac2e-4c29-9504-08daad24bae9 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Oct 2022 14:10:49.2019 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tseBhv8Ypu7t1C7c3uxeLwb9ddCKDl3XSeo76hVyI3d/43uBZSDv5LiNNswbS872ffDnQJnmfkGUf4L02ZSi/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7345 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Sunil V L > via groups.io > Sent: Thursday, October 13, 2022 5:58 PM > To: devel@edk2.groups.io > Cc: Michael D Kinney ; Liming Gao > ; Zhiguang Liu ; Daniel > Schaefer > Subject: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V3 03/34] > MdePkg/BaseLib: RISC-V: Add few more helper functions >=20 > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. >=20 >=20 > REF: > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugz > illa.tianocore.org%2Fshow_bug.cgi%3Fid%3D4076&data=3D05%7C01%7Ca > bner.chang%40amd.com%7Cb23d246aae8843c15cd108daad018f1b%7C3dd89 > 61fe4884e608e11a82d994e183d%7C0%7C0%7C638012519458082377%7CUnkn > own%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik > 1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DKflz7rvGivG00Ij > 6thrbhdf%2Bd1hVU7wBxEi45P6Ti0k%3D&reserved=3D0 >=20 > Few of the basic helper functions required for any RISC-V CPU were added = in > edk2-platforms. To support qemu virt, they need to be added in BaseLib. >=20 > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Cc: Daniel Schaefer > Signed-off-by: Sunil V L > --- > MdePkg/Library/BaseLib/BaseLib.inf | 2 + > MdePkg/Include/Library/BaseLib.h | 50 +++++++++++++++++ > MdePkg/Library/BaseLib/RiscV64/CpuScratch.S | 31 +++++++++++ > MdePkg/Library/BaseLib/RiscV64/ReadTimer.S | 24 +++++++++ > .../Library/BaseLib/RiscV64/RiscVInterrupt.S | 53 +++++++++++++++++-- > 5 files changed, 156 insertions(+), 4 deletions(-) create mode 100644 > MdePkg/Library/BaseLib/RiscV64/CpuScratch.S > create mode 100644 MdePkg/Library/BaseLib/RiscV64/ReadTimer.S >=20 > diff --git a/MdePkg/Library/BaseLib/BaseLib.inf > b/MdePkg/Library/BaseLib/BaseLib.inf > index 6be5be9428f2..86d7bb080971 100644 > --- a/MdePkg/Library/BaseLib/BaseLib.inf > +++ b/MdePkg/Library/BaseLib/BaseLib.inf > @@ -401,6 +401,8 @@ [Sources.RISCV64] > RiscV64/RiscVCpuPause.S | GCC > RiscV64/RiscVInterrupt.S | GCC > RiscV64/FlushCache.S | GCC > + RiscV64/CpuScratch.S | GCC > + RiscV64/ReadTimer.S | GCC >=20 > [Packages] > MdePkg/MdePkg.dec > diff --git a/MdePkg/Include/Library/BaseLib.h > b/MdePkg/Include/Library/BaseLib.h > index a6f9a194ef1c..9724b84eef89 100644 > --- a/MdePkg/Include/Library/BaseLib.h > +++ b/MdePkg/Include/Library/BaseLib.h > @@ -150,6 +150,56 @@ typedef struct { >=20 > #define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8 >=20 > +VOID > + RiscVSetSupervisorScratch ( > + UINT64 > + ); > + > +UINT64 > +RiscVGetSupervisorScratch ( > + VOID > + ); > + > +VOID > + RiscVSetSupervisorStvec ( > + UINT64 > + ); > + > +UINT64 > +RiscVGetSupervisorStvec ( > + VOID > + ); > + > +UINT64 > +RiscVGetSupervisorTrapCause ( > + VOID > + ); > + > +VOID > + RiscVSetSupervisorAddressTranslationRegister ( > + UINT64 > + ); > + > +UINT64 > +RiscVReadTimer ( > + VOID > + ); > + > +VOID > +RiscVEnableTimerInterrupt ( > + VOID > + ); > + > +VOID > +RiscVDisableTimerInterrupt ( > + VOID > + ); > + > +VOID > +RiscVClearPendingTimerInterrupt ( > + VOID > + ); > + > #endif // defined (MDE_CPU_RISCV64) >=20 > // > diff --git a/MdePkg/Library/BaseLib/RiscV64/CpuScratch.S > b/MdePkg/Library/BaseLib/RiscV64/CpuScratch.S > new file mode 100644 > index 000000000000..dd7adc21eb07 > --- /dev/null > +++ b/MdePkg/Library/BaseLib/RiscV64/CpuScratch.S > @@ -0,0 +1,31 @@ > +//--------------------------------------------------------------------- > +--------- > +// > +// CPU scratch register related functions for RISC-V // // Copyright > +(c) 2020, Hewlett Packard Enterprise Development LP. All rights > +reserved.
// // SPDX-License-Identifier: BSD-2-Clause-Patent // > +//--------------------------------------------------------------------- > +--------- > + > +#include > + > +.data > +.align 3 > +.section .text > + > +// > +// Set Supervisor mode scratch. > +// @param a0 : Value set to Supervisor mode scratch // ASM_FUNC > +(RiscVSetSupervisorScratch) > + csrrw a1, CSR_SSCRATCH, a0 > + ret > + > +// > +// Get Supervisor mode scratch. > +// @retval a0 : Value in Supervisor mode scratch // ASM_FUNC > +(RiscVGetSupervisorScratch) > + csrr a0, CSR_SSCRATCH > + ret > diff --git a/MdePkg/Library/BaseLib/RiscV64/ReadTimer.S > b/MdePkg/Library/BaseLib/RiscV64/ReadTimer.S > new file mode 100644 > index 000000000000..bdddb67618ab > --- /dev/null > +++ b/MdePkg/Library/BaseLib/RiscV64/ReadTimer.S Hi Sunil, Where is this code comes from? Was it written by HPE? If not then you can r= emove HPE copyright, otherwise please remove Ventana. Thanks Abner > @@ -0,0 +1,24 @@ > +//--------------------------------------------------------------------- > +--------- > +// > +// Read CPU timer > +// > +// Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All > +rights reserved.
// Copyright (c) 2022, Ventana Micro Systems Inc. > +All rights reserved.
// // SPDX-License-Identifier: > +BSD-2-Clause-Patent // > +//--------------------------------------------------------------------- > +--------- > + > +#include > + > +.data > +.align 3 > +.section .text > + > +// > +// Read TIME CSR. > +// @retval a0 : 64-bit timer. > +// > +ASM_FUNC (RiscVReadTimer) > + csrr a0, CSR_TIME > + ret > diff --git a/MdePkg/Library/BaseLib/RiscV64/RiscVInterrupt.S > b/MdePkg/Library/BaseLib/RiscV64/RiscVInterrupt.S > index 87b3468fc7fd..6a1b90a7e45c 100644 > --- a/MdePkg/Library/BaseLib/RiscV64/RiscVInterrupt.S > +++ b/MdePkg/Library/BaseLib/RiscV64/RiscVInterrupt.S > @@ -8,13 +8,13 @@ > // > //----------------------------------------------------------------------= -------- >=20 > +#include > + > ASM_GLOBAL ASM_PFX(RiscVDisableSupervisorModeInterrupts) > ASM_GLOBAL ASM_PFX(RiscVEnableSupervisorModeInterrupt) > ASM_GLOBAL ASM_PFX(RiscVGetSupervisorModeInterrupts) >=20 > -#define SSTATUS_SIE 0x00000002 > -#define CSR_SSTATUS 0x100 > - #define SSTATUS_SPP_BIT_POSITION 8 > +#define SSTATUS_SPP_BIT_POSITION 8 >=20 > // > // This routine disables supervisor mode interrupt @@ -53,11 +53,56 @@ > InTrap: > ret >=20 > // > +// Set Supervisor mode trap vector. > +// @param a0 : Value set to Supervisor mode trap vector // ASM_FUNC > +(RiscVSetSupervisorStvec) > + csrrw a1, CSR_STVEC, a0 > + ret > + > +// > +// Get Supervisor mode trap vector. > +// @retval a0 : Value in Supervisor mode trap vector // ASM_FUNC > +(RiscVGetSupervisorStvec) > + csrr a0, CSR_STVEC > + ret > + > +// > +// Get Supervisor trap cause CSR. > +// > +ASM_FUNC (RiscVGetSupervisorTrapCause) > + csrrs a0, CSR_SCAUSE, 0 > + ret > +// > // This routine returns supervisor mode interrupt // status. > // > -ASM_PFX(RiscVGetSupervisorModeInterrupts): > +ASM_FUNC (RiscVGetSupervisorModeInterrupts) > csrr a0, CSR_SSTATUS > andi a0, a0, SSTATUS_SIE > ret >=20 > +// > +// This routine disables supervisor mode timer interrupt // ASM_FUNC > +(RiscVDisableTimerInterrupt) > + li a0, SIP_STIP > + csrc CSR_SIE, a0 > + ret > + > +// > +// This routine enables supervisor mode timer interrupt // ASM_FUNC > +(RiscVEnableTimerInterrupt) > + li a0, SIP_STIP > + csrs CSR_SIE, a0 > + ret > + > +// > +// This routine clears pending supervisor mode timer interrupt // > +ASM_FUNC (RiscVClearPendingTimerInterrupt) > + li a0, SIP_STIP > + csrc CSR_SIP, a0 > + ret > -- > 2.25.1 >=20 >=20 >=20 >=20 >=20