From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.40]) by mx.groups.io with SMTP id smtpd.web10.29831.1665928612812676780 for ; Sun, 16 Oct 2022 06:56:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=GyrmWjuD; 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.236.40, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hKAl+gYHpnAOSTZxbiIWHfZ7m2S+bK/uVpFTbFQROwth8fA1Tdp+qyA7t8aOtepmJ8Rotwhq2SSbHYtbJnJgjYcD/7Bx6+RnPVOqbnCZ/gLUNctWf5dTm1+rOkziKzmyov+fUpQOTHItT7w5YNI6h4/iUI8N3lXB7qqooPemxVhlQL9461Gn9t+OnaobeSm33EPu4tab1plN6rQpDOgsfy7hD5CruvatZ8I16UF7lkcYDHNIoMWF5sq5/ObVI7GU3kUZO48LV1yjHTSKHw8wZDO3/Vkorpdsl0NciNzl9A17O+KtCIVQCKKBD3SP2c2eEvvYyxQIPkaTbQlw53EpKQ== 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=3h3jCWPwpEXGlMEG/gzHZKMDYlkW2kqHc0yPJ65pqxg=; b=M4tBTTi09FXNSsvzJkt4miP6rAlGj4gXFq3k+MTFM0dr+VD7mFIy0yMqZyFd8niGstTuUNbm6WHTpwuuicEbCZeG42v5WrEC80w/V+Yk92IsWS35LHfbkaCJ/J0F+r/zxnQBf9Ct4J+MaiDuiBFBu2T9gWN4OakLJT7p+C0eaEyvIHe3HUoYSk2M2H65FUfyD2QVi7lO/GBjsluya+uBRP+eXu0NBAQSFNaz1qM+0GfkBZz9fqI28qMcQeHB7cH4dx4Va9dQTsK/HtdPJjhPrV7mbsTJ2klzXZRbaXucuIXvxHWpTiPxY/WssoDDff3dnPQuOxviUJCOQqwy5iUFLg== 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=3h3jCWPwpEXGlMEG/gzHZKMDYlkW2kqHc0yPJ65pqxg=; b=GyrmWjuDBFoKVP3RcnHUf0Cn7/obsKlgH/5CBNkomN047ImTI/ke73Iz6Su5QNCDGK/b/h69kVj5bgG6/AAvyAhv7fqsWhZ8r0fDRgxLuFA++xXsWM1yApDr7akU8DJSBCPJ8CpiSBAcx5s5fI/6WvZLqgG/DqxhH/7ysf0QtpM= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by SJ0PR12MB6685.namprd12.prod.outlook.com (2603:10b6:a03:478::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.31; Sun, 16 Oct 2022 13:56:50 +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.032; Sun, 16 Oct 2022 13:56:48 +0000 From: "Chang, Abner" To: "devel@edk2.groups.io" , "sunilvl@ventanamicro.com" CC: Eric Dong , Ray Ni , Rahul Kumar , Daniel Schaefer Subject: Re: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V4 14/34] UefiCpuPkg/CpuTimerLib: Add support for RISC-V Thread-Topic: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V4 14/34] UefiCpuPkg/CpuTimerLib: Add support for RISC-V Thread-Index: AQHY3+0VIxkCpQx1XUaKxJCRHEh6Oa4RDlVQ Date: Sun, 16 Oct 2022 13:56:48 +0000 Message-ID: References: <20221014164836.1513036-1-sunilvl@ventanamicro.com> <20221014164836.1513036-15-sunilvl@ventanamicro.com> In-Reply-To: <20221014164836.1513036-15-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-16T13:56:46Z; 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=fb435282-b6d5-4d4b-a618-24bc10971305; 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_|SJ0PR12MB6685:EE_ x-ms-office365-filtering-correlation-id: bf770b68-7c70-49e2-0363-08daaf7e4509 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: R+J+NR5vCy4CKKhptU/HoKKtnQJFv0NhdLLDrThto5qlw6ArOe0SaFnzSyMaBsKE3Gb5OLO7eLCCNonIMwLBWjmeKUDpRpbFYLY7em0yNHqlp36Y7gX5DfYgxY7VZBe2aFAMjPyDQ6fG76INSgkBmcKedwVDhW0JnOW7Bkqc2Afrf9CQ2nz4YAy02zTzR9p7KAm/PqqfESqRqXO0Iwp1ZtbFKvdDNUrZgmuTqBP/FYvVmLFpmUeXoFfSVRrB+nYx22tUCzPCvvBqSc/DRfmABUYtqFvwH3MGu6Oy6+7G+BOMkA2whGq+mYkIfVLNpXi5GzTkwjAT0P0LNKhwEUYux2KK6k0wn8VsZ8M08j5TvjpxES8vzB0NHQFgq1yKHhdgAeY2w2R+8VXUN98XXm3uMhYXBi4BD+f//Xe3uOpj8jsGwGbvkk4CrGiYF75EEG4NQ0jGlvOtLtKLWdjHe57EJ70Gt1ehLLau5q4x+9GD9o0XKyoaS7T0++6XiIrDZpkHCYWrQ46Z/EgCZwnWa6Nsj1IfE0A8HJXIPkq6C1Q6U+0Bc4AO/LR/e4q/bXjnJtzP2ZV+/TDRpqyYydMNzZapNz4f7TeYJe+93X0OtF4HnTmgJ9+xAi/ehaoD0vbBkG+D/df993XVsU9435MWDwYf+PVvP9vdU9oYcYV7rYaZRJrKt7kjRSHV+Bdj58RVzaMObzqYKxlEaZ/kay0Ou9P4OjP4mDm1F3eDJQyPcz4LnhpN5wKaiuyBlynkFIvDFcyWw4YAJxUaTmaqtBxf0AQfyiHPpDEnTfMl2/6hvYFU3465a1jULEKj4dbPbbpESMqJUY12TAS9ksT29uSJFFkzhg== 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)(366004)(396003)(39860400002)(346002)(376002)(136003)(451199015)(186003)(83380400001)(38070700005)(54906003)(86362001)(38100700002)(122000001)(5660300002)(2906002)(41300700001)(4326008)(52536014)(8936002)(55016003)(8676002)(64756008)(110136005)(478600001)(9686003)(26005)(6506007)(53546011)(7696005)(19627235002)(316002)(45080400002)(66476007)(66556008)(66946007)(76116006)(66446008)(966005)(71200400001)(66899015)(33656002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?37jnBnptdXHF2JnWH/cIyhgN1o4RCz/ydQIx2/Nr5oXYlSij/OIzTMx1sjDC?= =?us-ascii?Q?5m5k7SQJqpJOYj5ZieDxNv+Bz5ARoCgao+aPTDKo6LSTlnyNiGXL1WRbfRyw?= =?us-ascii?Q?M2TBEVuRjId4OyWpRuIa13A9HlE31XX8xMxs5alsu93mvvJMuRtTh9N8Ff50?= =?us-ascii?Q?t+KuHqKQYns/8Ksge08XWIndHOJjH7VAJb6etZgDjkbaEiiFX/GIcytKYhpI?= =?us-ascii?Q?oR7yHLMdktKuhFnmBQciuJIQlfF8CQ9EG5WiJf1NJVzXLcrtBCSGxuGhPQm9?= =?us-ascii?Q?3DvC0L4evW+h0upkQSmcDP5ExzoN9dbWp4iBScMhwpEaQv3Fvba3XQjc4TNM?= =?us-ascii?Q?wCkJNaPiuRTb+eHMRB8JZJgGiJWWkH6kLKTAAG4+86GLw0anhFHAAZme7YDz?= =?us-ascii?Q?AqF6TcL4eScJu0rZlEeE64i4d/eZ1ZR0b61OrkYfLdl2lowgWXiAbLrPN8Ey?= =?us-ascii?Q?RP6MEHEtloKsWe0fglh9rgTveD3HcvhK/hrX/Z/9x6BYiCun2SjsBCX/sP1N?= =?us-ascii?Q?BeBMF3uwjWtUOYBnBF+3lw9p95xUN5WLI27bO2pm98h+MTloqCJ5zsUSNDK7?= =?us-ascii?Q?fd354PM0YCnA+BNpKYosx/K3yEJWZcYBTa20Eohef+ZNjsgv+J2gBo1PhPmb?= =?us-ascii?Q?N7giHEN/8NJ2QVffXQy/LqLQnRNZDTU9u0/sj10JbvVrwJlqD8zQOw/P4j9D?= =?us-ascii?Q?p+lgs4rfvwcJ3OfQf0x1V2HjI2R/+n6TZ9Vv87wUag1MvdQUH0suGE3GBAPX?= =?us-ascii?Q?r+fWIm77jy+Jum4moB7dR3tzN+XV+SCpm2YJl/Rbl7LJ7HKdQFtTlivYySFR?= =?us-ascii?Q?g2wVkULDnRhMhYsxv1VmYhNkz9Dgp0B97+CqjIJzAEiE5BZKlB473qeWIIZx?= =?us-ascii?Q?m5q0PfgcD7MxNScMN5iWiNvbEFBswdMWj2uyijSiXwoRUHGTYd8LvV1Ha0II?= =?us-ascii?Q?ID0hCdiKHIlPTRqsxufqxYRgIaY7pFrcxXzlAo630OL38FkFTU3IJqzD2WjN?= =?us-ascii?Q?FQJb6vqIvNjzP/irojWt898yFvWqJZ+WI+PEPiHK7SMl2rHb9Sin1nWp4Y4/?= =?us-ascii?Q?VQI1Qqvu8eDE4niqVsiZtnITPeoyseRqYNV69i8Cpobu1XrNnewr3SKuCGWm?= =?us-ascii?Q?4qLBJhpB5s5J+dM9UfryUTnDSm+w97Ta02xricq9rKSYIvPYfqSa1krKe69I?= =?us-ascii?Q?LDAuclzD6f1lluK02k1+oaDWXjXQp0oCCKtxK955yptqZutXwhKL2Ibj6DB3?= =?us-ascii?Q?z91leJ4UWpZp6FuveT/ywYh+gqYc861ttIwvU96NLpL27EwGDb9gJe/i5qxR?= =?us-ascii?Q?oaLDnFgo4UMCGA+I2lp0qWL4fOVMSaosJehwc/ZJI3Wd7L9DXqZBOclDMiOW?= =?us-ascii?Q?pRiY7nhI2m1K6w/qP3BW80wYRQDb0hwWPG8SLE11TcxB0uRZhrst8BRurihW?= =?us-ascii?Q?3bHJiyaLapAej/fV1C0aCO8bVqYm3xpIdn9ZiA43KevCzU226NVeRq6SGZcM?= =?us-ascii?Q?9gqd7ok6/i+URe7TgnNoKpZDBmmERXJC2ajz2l8RwudbxEPHCmKVfwlucvuQ?= =?us-ascii?Q?lnNiIq/HZbjDv4wK2raMcMq6tfkmmEDbX01pX+dl?= 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: bf770b68-7c70-49e2-0363-08daaf7e4509 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Oct 2022 13:56:48.5148 (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: 71m5I81Ftc/xhT3KKprJ42hKG9wvyzP9Fwmtbv9JBRm9yKgs2cljfnBncbCLjZQ6StJOSOxA/cl3i/S8xsEIug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6685 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 However, this one has the dependency with 13/34. > -----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: Eric Dong ; Ray Ni ; Rahul > Kumar ; Daniel Schaefer > > Subject: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V4 14/34] > UefiCpuPkg/CpuTimerLib: Add support for RISC-V >=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%7Ceaf8b2b498184b9f539908daae0436c0%7C3dd89 > 61fe4884e608e11a82d994e183d%7C0%7C0%7C638013630372412102%7CUnkn > own%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik > 1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DMisyEM5LX8ruF > SvIl%2FjeyVABYXm2GwS2qN8VITTbeE4%3D&reserved=3D0 >=20 > This is mostly copied from > edk2-platforms/Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib >=20 > Cc: Eric Dong > Cc: Ray Ni > Cc: Rahul Kumar > Cc: Daniel Schaefer > Signed-off-by: Sunil V L > --- > UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf | 3 + > UefiCpuPkg/Library/CpuTimerLib/RiscV64/CpuTimerLib.c | 199 > ++++++++++++++++++++ > 2 files changed, 202 insertions(+) >=20 > diff --git a/UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf > b/UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf > index 4b263965ed90..4492ee26caae 100644 > --- a/UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf > +++ b/UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf > @@ -22,6 +22,9 @@ [Sources.IA32, Sources.X64] > Ia32X64/CpuTimerLib.c > Ia32X64/BaseCpuTimerLib.c >=20 > +[Sources.RISCV64] > + RiscV64/CpuTimerLib.c > + > [Packages] > MdePkg/MdePkg.dec > UefiCpuPkg/UefiCpuPkg.dec > diff --git a/UefiCpuPkg/Library/CpuTimerLib/RiscV64/CpuTimerLib.c > b/UefiCpuPkg/Library/CpuTimerLib/RiscV64/CpuTimerLib.c > new file mode 100644 > index 000000000000..9c8efc0f3530 > --- /dev/null > +++ b/UefiCpuPkg/Library/CpuTimerLib/RiscV64/CpuTimerLib.c > @@ -0,0 +1,199 @@ > +/** @file > + RISC-V instance of Timer Library. > + > + Copyright (c) 2016 - 2022, Hewlett Packard Enterprise Development LP. > + All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > +#include > +#include > +#include > + > +/** > + Stalls the CPU for at least the given number of ticks. > + > + Stalls the CPU for at least the given number of ticks. It's invoked > + by > + MicroSecondDelay() and NanoSecondDelay(). > + > + @param Delay A period of time to delay in ticks. > + > +**/ > +VOID > +InternalRiscVTimerDelay ( > + IN UINT32 Delay > + ) > +{ > + UINT32 Ticks; > + UINT32 Times; > + > + Times =3D Delay >> (RISCV_TIMER_COMPARE_BITS - 2); > + Delay &=3D ((1 << (RISCV_TIMER_COMPARE_BITS - 2)) - 1); > + do { > + // > + // The target timer count is calculated here > + // > + Ticks =3D RiscVReadTimer () + Delay; > + Delay =3D 1 << (RISCV_TIMER_COMPARE_BITS - 2); > + while (((Ticks - RiscVReadTimer ()) & (1 << (RISCV_TIMER_COMPARE_BIT= S > - 1))) =3D=3D 0) { > + CpuPause (); > + } > + } while (Times-- > 0); > +} > + > +/** > + Stalls the CPU for at least the given number of microseconds. > + > + Stalls the CPU for the number of microseconds specified by MicroSecond= s. > + > + @param MicroSeconds The minimum number of microseconds to delay. > + > + @return MicroSeconds > + > +**/ > +UINTN > +EFIAPI > +MicroSecondDelay ( > + IN UINTN MicroSeconds > + ) > +{ > + InternalRiscVTimerDelay ( > + (UINT32)DivU64x32 ( > + MultU64x32 ( > + MicroSeconds, > + PcdGet64 (PcdCpuCoreCrystalClockFrequency) > + ), > + 1000000u > + ) > + ); > + return MicroSeconds; > +} > + > +/** > + Stalls the CPU for at least the given number of nanoseconds. > + > + Stalls the CPU for the number of nanoseconds specified by NanoSeconds. > + > + @param NanoSeconds The minimum number of nanoseconds to delay. > + > + @return NanoSeconds > + > +**/ > +UINTN > +EFIAPI > +NanoSecondDelay ( > + IN UINTN NanoSeconds > + ) > +{ > + InternalRiscVTimerDelay ( > + (UINT32)DivU64x32 ( > + MultU64x32 ( > + NanoSeconds, > + PcdGet64 (PcdCpuCoreCrystalClockFrequency) > + ), > + 1000000000u > + ) > + ); > + return NanoSeconds; > +} > + > +/** > + Retrieves the current value of a 64-bit free running performance count= er. > + > + Retrieves the current value of a 64-bit free running performance > + counter. The counter can either count up by 1 or count down by 1. If > + the physical performance counter counts by a larger increment, then > + the counter values must be translated. The properties of the counter > + can be retrieved from GetPerformanceCounterProperties(). > + > + @return The current value of the free running performance counter. > + > +**/ > +UINT64 > +EFIAPI > +GetPerformanceCounter ( > + VOID > + ) > +{ > + return (UINT64)RiscVReadTimer (); > +} > + > +/**return > + Retrieves the 64-bit frequency in Hz and the range of performance > +counter > + values. > + > + If StartValue is not NULL, then the value that the performance > + counter starts with immediately after is it rolls over is returned in > + StartValue. If EndValue is not NULL, then the value that the > + performance counter end with immediately before it rolls over is > + returned in EndValue. The 64-bit frequency of the performance counter > + in Hz is always returned. If StartValue is less than EndValue, then > + the performance counter counts up. If StartValue is greater than > + EndValue, then the performance counter counts down. For example, a > + 64-bit free running counter that counts up would have a StartValue of > + 0 and an EndValue of 0xFFFFFFFFFFFFFFFF. A 24-bit free running counter > that counts down would have a StartValue of 0xFFFFFF and an EndValue of 0= . > + > + @param StartValue The value the performance counter starts with when > it > + rolls over. > + @param EndValue The value that the performance counter ends with > before > + it rolls over. > + > + @return The frequency in Hz. > + > +**/ > +UINT64 > +EFIAPI > +GetPerformanceCounterProperties ( > + OUT UINT64 *StartValue, OPTIONAL > + OUT UINT64 *EndValue OPTIONAL > + ) > +{ > + if (StartValue !=3D NULL) { > + *StartValue =3D 0; > + } > + > + if (EndValue !=3D NULL) { > + *EndValue =3D 32 - 1; > + } > + > + return PcdGet64 (PcdCpuCoreCrystalClockFrequency); > +} > + > +/** > + Converts elapsed ticks of performance counter to time in nanoseconds. > + > + This function converts the elapsed ticks of running performance > + counter to time value in unit of nanoseconds. > + > + @param Ticks The number of elapsed ticks of running performance > counter. > + > + @return The elapsed time in nanoseconds. > + > +**/ > +UINT64 > +EFIAPI > +GetTimeInNanoSecond ( > + IN UINT64 Ticks > + ) > +{ > + UINT64 NanoSeconds; > + UINT32 Remainder; > + > + // > + // Ticks > + // Time =3D --------- x 1,000,000,000 > + // Frequency > + // > + NanoSeconds =3D MultU64x32 (DivU64x32Remainder (Ticks, PcdGet64 > + (PcdCpuCoreCrystalClockFrequency), &Remainder), 1000000000u); > + > + // > + // Frequency < 0x100000000, so Remainder < 0x100000000, then > + (Remainder * 1,000,000,000) // will not overflow 64-bit. > + // > + NanoSeconds +=3D DivU64x32 (MultU64x32 ((UINT64)Remainder, > + 1000000000u), PcdGet64 (PcdCpuCoreCrystalClockFrequency)); > + > + return NanoSeconds; > +} > -- > 2.38.0 >=20 >=20 >=20 >=20 >=20