From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.48]) by mx.groups.io with SMTP id smtpd.web09.30617.1665931691532227380 for ; Sun, 16 Oct 2022 07:48:11 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=Vf6j58qC; 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.220.48, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lFCuyHV62Qqf8zs63g0jOMnQfeeYJZw6AGnKe1ERoMz4anrRRwjXt0w4Lb3nMh8pffviAP+wObd/LEm/gq8yRDu9t337YKo/o1xj9FLkPMdaANiskWYrdpZZYAkcykp1+HZt2K4pY7Ul6u1z9C4/hmI07PAB4IAmkzTDwrd7XGPJZmO0yMl3DOfM5zzN920dzzuRVKPkttIFsMIzqAoKISB/MNb6sjW3In+ORn0FEW9nsLfW7JmOY0t/PHrX5bICO739bUQNAub9XBaFKfND1Rgdx/UPVAV0Mp9TDcU2aais4kHG7LZEWO6OmB8Dazxm8KCrRLP9igS3eB34cd8x9Q== 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=b3qZ4uHzOU2+9Rm9jZhWgm87aKan7WwNcPgGqmBn3MM=; b=Wt8YdC8UyYurHtR73dUZuluP8YS+Ibi4yMOvHhbGoMsQpOMNaNysxYAlA21r9OGvXsUYmR4qKY5TDqvRq0IXymZ/PWSoXgYmDe/KlYL6dF/8rdDnV1wMQDJbsqLhmx3WsRa48YRVuYrevYxCz0Faui+EI9r5mExwg8PjRUqPIIq95eL4qOhMixaeqcLxM0GfmIDFtVEJE9gRcC+eSTNMUPp76jq7mMjn5ciwFra4V8G069o3EgNi1nKdHyZPpedcG9yJTeIByN1Yh8tWHe8k8zP3uAiN2DXLEehkeDWhtX1j761rlTvDCNrtgA36npoS5Opsl5Zk4h6XJxj8Cy+Y/A== 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=b3qZ4uHzOU2+9Rm9jZhWgm87aKan7WwNcPgGqmBn3MM=; b=Vf6j58qCUXHHJEH40BfFXPoK94+Q6ub2vNfVH9YPNCBvRBJ3hseBdSdnY+AgjSv/8pSrwFv6v5ieoPoRe1D4KHJ9yM5a3KIUmBzlxgFU4Y8aam5QdkXwEu6tl5qLgg/9L2ywoIIK6cEoniRXwSJFRrcoDAefsloyIhibTkPRrJg= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by BL1PR12MB5971.namprd12.prod.outlook.com (2603:10b6:208:39a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 14:48:09 +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 14:48:09 +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 19/34] UefiCpuPkg/CpuDxe: Add RISCV_EFI_BOOT_PROTOCOL support Thread-Topic: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V4 19/34] UefiCpuPkg/CpuDxe: Add RISCV_EFI_BOOT_PROTOCOL support Thread-Index: AQHY3+1H5637hqlZRUySMI63j2gZYq4RHGhw Date: Sun, 16 Oct 2022 14:48:09 +0000 Message-ID: References: <20221014164836.1513036-1-sunilvl@ventanamicro.com> <20221014164836.1513036-20-sunilvl@ventanamicro.com> In-Reply-To: <20221014164836.1513036-20-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-16T14:48:07Z; 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=b77bb974-e0dd-40a3-bf97-fd6bf9f5cc6a; 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_|BL1PR12MB5971:EE_ x-ms-office365-filtering-correlation-id: cd314c0d-394a-43d4-cfe9-08daaf857135 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3rnLAfrTRd/IYwy1EuxqJAKws2JDgLUX6UyGBVIPKbuXwkrmWeEiQqTKakoyFryoMLhswNUr21Ktuluf/+aIEBGeIvYmGPasZirZkZSk7ZEM55f/VGVQur+sP7B841ErlnSNAE86nF3fGv7Yr8Tm5D0bwttSCvA+h9lcLvLpGXA5XvtU1NEW94ZCEZlGyHU+ooPKO7qDF1fsxZ/rn/sgIkx21O+J6hV3OS48L21Od7Go7M/hZS+Y7sIYlDPD9E4G3knl7lWjC4EJCYlW2LxepBSVXdPITTGTvUrKHtn5joUrbC9+mKUQt11hvkduCUm21mEQ/7oeflc6cYkemhKigbeLTnh/Rw2/6d2O+ZH3cRCX/rYbiW2Ly78HkzCghbJGU1M95EQdUvzka32UhK/Z0sqmPMtLQfT908IrJ2MF213kyuR0XiC9Pcm3m3z/iC1i6dINOUbERF6Coz3QpvXQTqm38a7ztXifUjdXJZIXa9VFATt9P4ZskySHlP22VhUjPN2IMijSyX2xEdD1rZXnwNKcSdX3m+wO0mPxibRsWZsk2Iw6So4cfKQ999T5lVHuAqvXHrJFgnLe4TAgRneyVpHzYYVG31gnLFg748rARVRfi/vSy+zcraIsf7+3BQtHIbmX64Ff5sgXfUusovZMYIS8OXpbDF8GXK7aao9uP+KLzFEu2UjDGeFPwfvwBLtTgBd8gQhlW5Z5hPyyNj2GGuzDI82rCNAfY6fGFkJ/lTnYgxu/kIT5A1cIWBKpksEOexz0CHEPs9e/cfsCxeo+bt7wLKKOkCECp0z0KnrSTm6luUPmhMoHsY5zImFkiq6afboNTAdDeWwBKK3VC+VrQA== 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)(136003)(346002)(396003)(376002)(39860400002)(366004)(451199015)(8676002)(4326008)(66476007)(66446008)(64756008)(54906003)(66946007)(66556008)(83380400001)(41300700001)(76116006)(53546011)(7696005)(6506007)(110136005)(86362001)(55016003)(19627235002)(5660300002)(52536014)(26005)(9686003)(8936002)(316002)(66899015)(2906002)(33656002)(38100700002)(186003)(71200400001)(966005)(38070700005)(478600001)(45080400002)(122000001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?rxMSK8LvJbN1bakYNeyJRYXq6amd0DSp/EA5ymXTj+eI7ruDqtq/wVF9xyvI?= =?us-ascii?Q?6wGDSIm8gMn9mmpIVLW01CYoTykDAUa5RXVFFKos5Pa7H2dpfHp9ptg1Tu7N?= =?us-ascii?Q?fY0UhC1v2PvrcLAdCfsBN8BIcyxYCSkLVyMN1HCSz0Uv+jbU+TNfg6OaxDSd?= =?us-ascii?Q?abbYfqrePewf18C2gMHEC12rQp8Pxm1NrJE6K7VfNGRwyk80duuAMc1/UCQh?= =?us-ascii?Q?7GDOvNEnBYohcZb0sqf3+OW/mOOq22kQfEr8UmIlPsAEQG6usHTdDan8F8ay?= =?us-ascii?Q?L9n2sw72OPRyQbZ+YfENcCkxBaELxVJF3mrIE5h+55qNbsgEguaGB3q8r8JN?= =?us-ascii?Q?J7G6labydolEPvq+RO7W+WD1DHXlIYV37cNckHAeNUNBOZzk58EKcoGJ8I72?= =?us-ascii?Q?nZA6+501W6x+GJqp4XFrh1GCIzPmG8U5/dswP+iuvKz8F5I2nSpcAUUlwf4k?= =?us-ascii?Q?F73WgzbFgzXGcdfq1vH3UehuhIT6yp0CqEnzF6WqQ8/9D6ugwceSxAAtw1Qi?= =?us-ascii?Q?mZd9UxuP27b/LfRpt40inOP5d5TkcXpgWJZGnMvm4+CXYpkkWQ+gMOItUuYR?= =?us-ascii?Q?7DvBwIgQCiGBuI5dKZK71gseeggmaHi4y0kFFwHm/9UjaED8R+aZ1kkWFbei?= =?us-ascii?Q?DiCeeWMQv5PfLyX40C1LrTEjsf0MiCuL0Lb2f3QJJPpgv0XURC1tOuSuRcfX?= =?us-ascii?Q?z2lsu+lMsZ+4B98L4OVCiXv9wq3FteiItKXWJvW43t48Gb+VrHQI2blgbgeA?= =?us-ascii?Q?dfmvQbxnFybgT+JimseZY6+moSqpWR6oMZc564rZlbBK4sJRXTI7GbaTWOUC?= =?us-ascii?Q?797MJ6VBvJzF6HdqhUCXe+llrFJ+FXc5b8X2gURP3TzpH+/SbX45lN0nAS3M?= =?us-ascii?Q?WatuOShVqoT4/9CW8J9qMo7DmlmbRIPiPY9fiPCDFLQaOOEgz5jB/Y1laNoa?= =?us-ascii?Q?0AimkERI6RykU1ykSaXYGB+hKQCVNDfCV7pcQbm1nH/keI0kcEgiiRgJ03eD?= =?us-ascii?Q?CwvqfB5zcgs/8VrKEjzlpYDdFrRQjt6njBWCfHKXS4GprF/trhq3+agryLtf?= =?us-ascii?Q?OuJb62kxKCHQSre/m9kHmkPBc1iqyOD6IRknfhpzOF+XxUdXJMBTTe+O3+Cs?= =?us-ascii?Q?dtyv9kN+lM2RqtscXiQCmzARPjvR/06/YgbrVasvM3zu84rbHHoiaAQixRAX?= =?us-ascii?Q?nHCIyFiEGVWssW/OEEMzRVDS3yFNi436AAyTWkwk5PiXuzQDr/U5h7zqCZK0?= =?us-ascii?Q?2WAiJgXnH8NMfJSoONoJY9P6Oh3zZgxm/6pBWC3/FLxTO6SDudEr4+CIJYmE?= =?us-ascii?Q?tL18/EnUGfaqiBbwlKnOspCQfmXtf0Xj09o20WKtRTXHm1QrnmG152+k5ndD?= =?us-ascii?Q?Ez51k2mKMcu+wu0Puuiou7V7IDDEzmPya2f1yEgygrfQ2sPDLj2aCYnfJ/Ds?= =?us-ascii?Q?Ezw+NHQSeGgubY0RJTI5M1FB+50hMHZ37GAgm42nTfKzzaqS+hidT1sG/Asm?= =?us-ascii?Q?sndaBcsFHBk1fxZhdoYC+kNqHTTPctuTQVp1WCdZcBkHBSh1vc8R+8UISDui?= =?us-ascii?Q?klXvLRK5VctXd4HcxPdNnljvKp3c7hQuDxAJCRnr?= 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: cd314c0d-394a-43d4-cfe9-08daaf857135 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Oct 2022 14:48:09.0584 (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: 2Dp3y2RoRdbJgS1RAxUrHJHViSy+GGAYFWxoF4ZCqjPwEqMp3QchF8sUweVcsiFxChqsk2beNAexQU0snlOeqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5971 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] The implementation of RISCV_EFI_BOOT_PROTOCOL looks good and the copyright = is clear. Thanks Acked-by: Abner Chang Abner > -----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 19/34] > UefiCpuPkg/CpuDxe: Add RISCV_EFI_BOOT_PROTOCOL support >=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%7C1585e32f06574b8131ef08daae046155%7C3dd89 > 61fe4884e608e11a82d994e183d%7C0%7C0%7C638013631208922591%7CUnkn > own%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik > 1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DZm3JNrM1BG0z > o33Qpj1oCzgn6JcEgIB5gb40q2dUyZk%3D&reserved=3D0 >=20 > RISC-V UEFI platforms need to support RISCV_EFI_BOOT_PROTOCOL. > Add the support for this protocol which is defined in the spec: > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgith > ub.com%2Friscv-non-isa%2Friscv- > uefi%2Freleases%2Fdownload%2F1.0.0%2FRISCV_UEFI_PROTOCOL- > spec.pdf&data=3D05%7C01%7Cabner.chang%40amd.com%7C1585e32f065 > 74b8131ef08daae046155%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C > 0%7C638013631208922591%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLj > AwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C% > 7C%7C&sdata=3D5CB%2F89Lz5OTmFZQaoCk17VbEiXu5ggPSgL0PVeuFPTM > %3D&reserved=3D0 >=20 > Cc: Eric Dong > Cc: Ray Ni > Cc: Rahul Kumar > Cc: Daniel Schaefer > Signed-off-by: Sunil V L > --- > UefiCpuPkg/UefiCpuPkg.dsc | 12 ++-- > UefiCpuPkg/CpuDxe/CpuDxe.inf | 3 + > UefiCpuPkg/CpuDxe/RiscV64/CpuDxe.c | 60 +++++++++++++++++++- > 3 files changed, 68 insertions(+), 7 deletions(-) >=20 > diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc index > f694b3a77c2e..6ea90507e36f 100644 > --- a/UefiCpuPkg/UefiCpuPkg.dsc > +++ b/UefiCpuPkg/UefiCpuPkg.dsc > @@ -122,9 +122,13 @@ [Components] > UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf > UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf > UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.inf > - > -[Components.IA32, Components.X64] > UefiCpuPkg/CpuDxe/CpuDxe.inf > + > +UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.i > nf > +!if $(TOOL_CHAIN_TAG) !=3D "XCODE5" > + > +UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLi > b. > +inf > +!endif > + > +[Components.IA32, Components.X64] > UefiCpuPkg/CpuFeatures/CpuFeaturesPei.inf { > >=20 > NULL|UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLi > b.inf > @@ -141,10 +145,6 @@ [Components.IA32, Components.X64] > UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf > UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf > UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.inf > - > UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.in > f > -!if $(TOOL_CHAIN_TAG) !=3D "XCODE5" > - > UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib > .inf > -!endif >=20 > UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.i > nf >=20 > UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf >=20 > UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHa > ndlerLib.inf > diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.inf > b/UefiCpuPkg/CpuDxe/CpuDxe.inf index 235100d86274..b16b640946c6 > 100644 > --- a/UefiCpuPkg/CpuDxe/CpuDxe.inf > +++ b/UefiCpuPkg/CpuDxe/CpuDxe.inf > @@ -74,6 +74,9 @@ [Protocols] > gEfiMpServiceProtocolGuid ## PRODUCES > gEfiSmmBase2ProtocolGuid ## SOMETIMES_CONSUMES >=20 > +[Protocols.RISCV64] > + gRiscVEfiBootProtocolGuid ## PRODUCES > + > [Guids] > gIdleLoopEventGuid ## CONSUMES ##= Event > gEfiVectorHandoffTableGuid ## SOMETIMES_CONSUMES ## > SystemTable > diff --git a/UefiCpuPkg/CpuDxe/RiscV64/CpuDxe.c > b/UefiCpuPkg/CpuDxe/RiscV64/CpuDxe.c > index 9f557b776a09..7551e0653603 100644 > --- a/UefiCpuPkg/CpuDxe/RiscV64/CpuDxe.c > +++ b/UefiCpuPkg/CpuDxe/RiscV64/CpuDxe.c > @@ -2,6 +2,7 @@ > RISC-V CPU DXE driver. >=20 > Copyright (c) 2016 - 2022, Hewlett Packard Enterprise Development LP. = All > rights reserved.
> + Copyright (c) 2022, Ventana Micro Systems Inc. All rights > + reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -14,6 +15,39 @@ > // > STATIC BOOLEAN mInterruptState =3D FALSE; > STATIC EFI_HANDLE mCpuHandle =3D NULL; > +STATIC UINTN mBootHartId; > +RISCV_EFI_BOOT_PROTOCOL gRiscvBootProtocol; > + > +/** > + Get the boot hartid > + > + @param This Protocol instance structure > + @param BootHartId Pointer to the Boot Hart ID variable > + > + @retval EFI_SUCCESS If BootHartId is returned > + @retval EFI_INVALID_PARAMETER Either "BootHartId" is NULL or "This" i= s > not > + a valid RISCV_EFI_BOOT_PROTOCOL instanc= e. > + > +**/ > +EFI_STATUS > +EFIAPI > +RiscvGetBootHartId ( > + IN RISCV_EFI_BOOT_PROTOCOL *This, > + OUT UINTN *BootHartId > + ) > +{ > + if ((This !=3D &gRiscvBootProtocol) || (BootHartId =3D=3D NULL)) { > + return EFI_INVALID_PARAMETER; > + } > + > + *BootHartId =3D mBootHartId; > + return EFI_SUCCESS; > +} > + > +RISCV_EFI_BOOT_PROTOCOL gRiscvBootProtocol =3D { > + RISCV_EFI_BOOT_PROTOCOL_LATEST_VERSION, > + RiscvGetBootHartId > +}; >=20 > EFI_CPU_ARCH_PROTOCOL gCpu =3D { > CpuFlushCpuDataCache, > @@ -285,14 +319,38 @@ InitializeCpu ( > ) > { > EFI_STATUS Status; > + EFI_RISCV_FIRMWARE_CONTEXT *FirmwareContext; >=20 > - InitializeCpuExceptionHandlers(NULL); > + GetFirmwareContextPointer (&FirmwareContext); ASSERT > + (FirmwareContext !=3D NULL); if (FirmwareContext =3D=3D NULL) { > + DEBUG ((DEBUG_ERROR, "Failed to get the pointer of > EFI_RISCV_FIRMWARE_CONTEXT\n")); > + return EFI_NOT_FOUND; > + } > + > + DEBUG ((DEBUG_INFO, " %a: Firmware Context is at 0x%x.\n", > + __FUNCTION__, FirmwareContext)); > + > + mBootHartId =3D FirmwareContext->BootHartId; DEBUG ((DEBUG_INFO, " > %a: > + mBootHartId =3D 0x%x.\n", __FUNCTION__, mBootHartId)); > + > + InitializeCpuExceptionHandlers (NULL); >=20 > // > // Make sure interrupts are disabled > // > DisableInterrupts (); >=20 > + // > + // Install Boot protocol > + // > + Status =3D gBS->InstallProtocolInterface ( > + &ImageHandle, > + &gRiscVEfiBootProtocolGuid, > + EFI_NATIVE_INTERFACE, > + &gRiscvBootProtocol > + ); > + ASSERT_EFI_ERROR (Status); > + > // > // Install CPU Architectural Protocol > // > -- > 2.38.0 >=20 >=20 >=20 >=20 >=20