From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com [40.107.96.68]) by mx.groups.io with SMTP id smtpd.web09.19493.1665840605576664159 for ; Sat, 15 Oct 2022 06:30:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=fci/jWO9; 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.96.68, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GU0/PAdpLwcnPk/LK5F+w2UiPx3GFyVQaS6TEzmGOzg0Uk9xOxN0xGQqyvVD1/1jG16gGyTSVdbJfKNbyxpK6GdU8n2PjHzb8XnSDhQFkPJSzGax2xRtLy/1wT4wf99rNerJoZWHPQZoYSNvPOUKKSZESPMaHEBGnepi/nJOXHrppyKjsESUQWxXAw/kJLtd+7ndZsrxztbxRtdGGUwM7PfwLK1NdKGJdlrgrk3a1WVJffsBt2LMsdM8xDYua0QsZ78devzRxBl3vITjufF4hgh2uInFR0M+i7LNaUkpCVdhXlz2tX8GS78Ctpy+D34YnYkmRLpQBr1o/1McIq13Pg== 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=99HT1Da3NcPHEY7XYX+tBq3JMjtetyE2xkYIPib7ecA=; b=nmYevvFyK5t0ln1GXdrUAT82M4/JZQphZBjD/TjPwMzOau1kpx+6i7H2c3mRsJ+uk6ZfkOetuoTv5yVx0TGpDoHxqcyUHGCDtzE1JxLr4tMM0lD+4DdC6iyel2xqrVFJtmtKZ3jLB18bZBqC7rTMxzu42FMvijyEpN6Iwr7sc38sabP4Z5kBxJknduqSoiO3UJBKW5r7PCaEgHznfZQzffq5MGDn1+BGsAy9VznGv/t4YEpooNVS6BoueexmNXgP4+To93+BlTVNxirHFM4bVTUCED7g+RI+pmyXXyqWNNwf9Or02qAb7uxrboPRb/oNXWcJF0H8j8am7Me3qr/8nA== 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=99HT1Da3NcPHEY7XYX+tBq3JMjtetyE2xkYIPib7ecA=; b=fci/jWO9l3Gmj1eRGkZJAhT4NlYf4YMuwaWSbF+hHDKYMVYKdSAumDuo7MLvpDNK10Qees6V9fPS1JE0+v8DGvLJ/SbhTeEDDCe2van2/Q0VIi10my9HEdWqX13RhClK0mRsmm4ocEB8xauxPI3VnFiFqVOBNjS33IciEOB9tJ4= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by DM6PR12MB4941.namprd12.prod.outlook.com (2603:10b6:5:1b8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.30; Sat, 15 Oct 2022 13:30:03 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::2eab:b851:827c:1d88]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::2eab:b851:827c:1d88%3]) with mapi id 15.20.5723.030; Sat, 15 Oct 2022 13:30:03 +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 V4 03/34] MdePkg/BaseLib: RISC-V: Add few more helper functions Thread-Topic: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V4 03/34] MdePkg/BaseLib: RISC-V: Add few more helper functions Thread-Index: AQHY3+zjSxr5t9rnEkGbPKy3Krcn2a4PdJVg Date: Sat, 15 Oct 2022 13:30:03 +0000 Message-ID: References: <20221014164836.1513036-1-sunilvl@ventanamicro.com> <20221014164836.1513036-4-sunilvl@ventanamicro.com> In-Reply-To: <20221014164836.1513036-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-15T13:30:01Z; 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=5871d653-b9e0-4681-bd7b-0e6487c38701; 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_|DM6PR12MB4941:EE_ x-ms-office365-filtering-correlation-id: cac1ab77-5bb2-4aa4-3113-08daaeb15de1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8KN6btZpRJoLrj6pbHXLq9e76YttgYusFWnah1Hg90AHvHT+cCtFSsVNL2e/EjWA52oPGfCTIktAqcBKEJTofTPxDbTTcNIIZMIP2+aO8esvbkES/nhWTUb8EG9VKRr5K9J9FkiiupRXNM6bmeohSBwvRsTUf1LYCdCZIzSJLmD1H6svy7XUbj7Swc9kmE+HuDDkOdjkhviHFzANNlp9XwUbW5pmsI0+ZLpmUrHDHq9I/+VWS98/TwlulBQW8+bHo4gPxjRgjQzGjeWBM9hvwHZF0idKK66lC/Nv4PvOq7CgGeTKcDKDFneaItQVJEAhtUuuvKce5MhS4IUHvRBpFhiZoG6my4G5IYA5+3itQuy2U+lyNET3GkMwD3E62pSNqE+XfYmMMBw5BnxD+90EHvPOiDhmuTvsizzhb+TAdPK2HG5d9tc+Zz8EZe50eGzscpKTWKdSHiRC95XOnBX5+hOH70SDGItjuIzIyX1fEnNA9fLwE/g6S/u3IJ5kRbULfGW2E7blnAXXajNqRgJHoB+jbTWrGkKWeWVbDhOG45BAroBap0PMdEsVhOU0V/aY8kxWvDrBLQo8RDIciBifvqMjMgL5TWUwAvRcWrk76eymxYjjzO6QOKdbfdCW0yy6Tm2tTNJz5u0Suuq91kcFVsG04OLUYf4I7T8I9mBA7eWwlrdLnKLZthT+hO+4fhSdfcah9TsvLdr/MzMWiSuLN4rwqy7b0MuIdKlj20RtJmR3dp7Pt4j6p0GMgoSl3t751fXqw5hr1TuAdY8Qd8EOKe0LudqFXOT/sHFaIjLpQoi6StflXi6/e9MsyxHxAm6JWr/g7leMHce3I9d57GVo5Q== 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)(396003)(136003)(39860400002)(366004)(376002)(346002)(451199015)(33656002)(66899015)(86362001)(38070700005)(38100700002)(122000001)(2906002)(83380400001)(55016003)(5660300002)(7696005)(6506007)(53546011)(26005)(9686003)(186003)(316002)(966005)(45080400002)(478600001)(54906003)(19627235002)(110136005)(66446008)(76116006)(71200400001)(4326008)(66556008)(66476007)(64756008)(8676002)(41300700001)(66946007)(52536014)(8936002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?c7bJbhMH8FCufGHHvAKNiSnNjMhNu6DGZVFSH2NHOXOG5DPPIMl4ZF0JDu2y?= =?us-ascii?Q?N3oNsJr0MIjXYVmBLnIUyxxRL1le2vrO7QXhCENt3LU2dpZ/SfNZ4druMent?= =?us-ascii?Q?a4Q8/Q/7e5TyExkxmQNuMwx7xk4DEarhFcss4fUbkTDQA53SmsSmu+sGw2BR?= =?us-ascii?Q?Qopag0qS0RiLDzXh7/NwlIQyXYrKVkBgJGJJdp3h67zKtbjCKPsAHzrwtY0z?= =?us-ascii?Q?oUX9Pctja3U4AttJJjVyBpjuRbwI1BeAwFrSlpiAWEd4sW8Y3pFPNeMot0Cx?= =?us-ascii?Q?SvQK0lsRAm/xE2s03Ctm3uIs30D9jhpj139OkZW8EiJtyZQgCUEI7jmcNevc?= =?us-ascii?Q?w51XVyQRupWwYbDOOUJBi/s9trD4Q9yF9bhOYUcb1w3zjiZst6fLupTRCJIy?= =?us-ascii?Q?ksEAM1JSm9sQxqZfoWA8WqxPqusPU2fZMQGSl6DJSw98WoAvSvy8+0Dsh6I9?= =?us-ascii?Q?njDGwpbflWbR4Oq6i1Q5lEMT58/xqinfLnNdamIPx5xc/B6kbn6mvTQykh3P?= =?us-ascii?Q?DWTdpnVcM9qWE6dS9abNh671rL7Y5U94UHHQc7BxsESuki+RMWgJjmO0NhLZ?= =?us-ascii?Q?wak0UXr4d0O2Q+iegiOHKP2JEY0hmswqDLUiqCifYj+CcxapB+Ivf4s9CJDY?= =?us-ascii?Q?fq9ITul/UzctlAF4Hw8uWkRqjRJ63cAx4+haKKKDU63Aigd+hcHolvAGERx6?= =?us-ascii?Q?spjLxqUbjN5oFd5FM86aeFAOuP6X5NJBWork+GzGRV4QPf/FYVRN339/hayE?= =?us-ascii?Q?kMDe4Tkvjm0yzRswA2TA6UCGlTcxyRVhkuolzpz0xuHU2D4RhU5a4TsMJtPF?= =?us-ascii?Q?jHMqGjFAG0lkVPOouxkClrrIErVsJQwdA1FeWzoKZL8lsxbkUrEwVW6RF+jO?= =?us-ascii?Q?5ZKCsH33pAzGVy+vrt9gzryXOVLyPfgEGLICB0aX9YyN/Rgd91gEjWAXsX0e?= =?us-ascii?Q?E6oo+z+6DIzp9gbXkMDns+EZOGcDlF5STjVIlKjzT2LDrG+OshrsDSdKzXNo?= =?us-ascii?Q?xS0AYyx1qfSfDLXgLUPYjTXf3C8t5waYsG9Cn0TTydEKXpUkUM1LCWCLlPD+?= =?us-ascii?Q?lEjxSaFbuF22FFYPsSwjyNLojYe1NXNDkTWzOCKeVbVWcytUlqIxAUsuj/y9?= =?us-ascii?Q?z3MaA2wSxzGrUbOM329iOQGKtkmrZy4535dVMw1YsQ6m7zMFDtEs29zh0Opp?= =?us-ascii?Q?SmL7g7bVZwX9rKqw1NAaHuBg1042t4CY6A9Z+vY2RrhzQxOldKnvrCuPCteS?= =?us-ascii?Q?BFKUwa5UkdNXBlvk7fZ1JUmNl79b9RUK7wwffFq88I6A9HUIO+XBYWYGQHAb?= =?us-ascii?Q?GbDmawNGGIOeLEixV4FzWGGFhK3PpidHCnfZ0Q+sAoO0JvO/aFi7131UfcUW?= =?us-ascii?Q?PfjlZ/CNdevn9ZK1y7PNkuvxDULdQwfWk5Gk95/f3bwfFf/sF8hLOBTTqmBB?= =?us-ascii?Q?Qyd7C8132Bw6Q+WzMP/CXrfDPvwsBqaCcPv0v0sh6tZX38vuto+8vujElkxk?= =?us-ascii?Q?ZTe9u3Z/P+yPvekQklGAJYyfy+ITozdDUNh19g9CY/gaK8QCbWGxWvBWhxiv?= =?us-ascii?Q?A2XL24YkJW2vcDfKJeq4PSVMG06gzvZon18+HgN1?= 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: cac1ab77-5bb2-4aa4-3113-08daaeb15de1 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2022 13:30:03.3673 (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: o1fGF5xFIxgfUenyuKjqQ7DgqdMD4zeBHAtkta3klP34IlOPA7PAYOfX85k5Gd+hvlI3Yt4nZRzbnk9cO6wcxg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4941 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Acked-by: Abner Chang > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Sunil V L > via groups.io > Sent: Saturday, October 15, 2022 12:48 AM > To: devel@edk2.groups.io > Cc: Michael D Kinney ; Liming Gao > ; Zhiguang Liu ; Daniel > Schaefer > Subject: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V4 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%7C888ce51602864f8bc06908daae04049b%7C3dd89 > 61fe4884e608e11a82d994e183d%7C0%7C0%7C638013629522461744%7CUnkn > own%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik > 1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3Dz8dHFBuQTDb > m0%2Blceek7CFuH%2BcG2NfXwT9ANbi92GJU%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 | 23 +++++++++ > MdePkg/Library/BaseLib/RiscV64/RiscVInterrupt.S | 53 > ++++++++++++++++++-- > 5 files changed, 155 insertions(+), 4 deletions(-) >=20 > diff --git a/MdePkg/Library/BaseLib/BaseLib.inf > b/MdePkg/Library/BaseLib/BaseLib.inf > index 9ed46a584a14..babbee1ca08b 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 > [Sources.LOONGARCH64] > Math64.c > diff --git a/MdePkg/Include/Library/BaseLib.h > b/MdePkg/Include/Library/BaseLib.h > index f3f59f21c2ea..b4f4e45a1486 100644 > --- a/MdePkg/Include/Library/BaseLib.h > +++ b/MdePkg/Include/Library/BaseLib.h > @@ -151,6 +151,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 > #if defined (MDE_CPU_LOONGARCH64) > 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..39a06efa51ef > --- /dev/null > +++ b/MdePkg/Library/BaseLib/RiscV64/ReadTimer.S > @@ -0,0 +1,23 @@ > +//--------------------------------------------------------------------- > +--------- > +// > +// Read CPU timer > +// > +// Copyright (c) 2020, Hewlett Packard Enterprise Development LP. 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.38.0 >=20 >=20 >=20 >=20 >=20