From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web12.94.1571113614237067453 for ; Mon, 14 Oct 2019 21:26:54 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=019184da0c=abner.chang@hpe.com) Received: from pps.filterd (m0148664.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9F4QnES030807; Tue, 15 Oct 2019 04:26:49 GMT Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) by mx0b-002e3701.pphosted.com with ESMTP id 2vmha9tf63-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 15 Oct 2019 04:26:49 +0000 Received: from G2W6311.americas.hpqcorp.net (g2w6311.austin.hp.com [16.197.64.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g9t5008.houston.hpe.com (Postfix) with ESMTPS id 38BED7C; Tue, 15 Oct 2019 04:26:20 +0000 (UTC) Received: from G4W9331.americas.hpqcorp.net (16.208.32.117) by G2W6311.americas.hpqcorp.net (16.197.64.53) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 15 Oct 2019 04:26:20 +0000 Received: from G4W10204.americas.hpqcorp.net (2002:10cf:5210::10cf:5210) by G4W9331.americas.hpqcorp.net (2002:10d0:2075::10d0:2075) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 15 Oct 2019 04:26:19 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.241.52.10) by G4W10204.americas.hpqcorp.net (16.207.82.16) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 15 Oct 2019 04:26:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sa7l7eZ5298/cvvzZl86SwKRt4IjCJJW2SkkcgniHnTpI7JtH7m9GaHk2t4qT34drEiJaVdlqLUnY63y3d0tnw5lrWkahJQ82ZvhpVWDJf5ue0JqksaQZuIb/1EPmoCpJubaZL8OKfthVXIxmrCdaw14W2iUx7wa5ac9lUh0wu18TBUSAiZwQF3gf6oYX95L0/cBQdydDiwHhnXt4ekDUf0f1oxuTCgXNBQbzJZaUNOshD1RGqZ6ljjxhST76nSPS9EoDjIYmBKXjW8YhX5IR/eKybmXU0KLFX8MSDNwGK01aMrxsa/UK4dwnNk2pJ3aHpypHQCc4/pPbYy49iYbbQ== 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=50Rivl4UWsfP6/CcNydwHqS2JVA1wiPBcHrOHoLKkbQ=; b=RBgfYWBjcjdCM1u2IZ7IeDD8Yps+FydgnOPLcriL1tYuJvd6hSUNLEEDVnN+ywlWkn0tgJ3xyw82+N9AC4fceTRHYZcl7PoyA6tdVgVpklioxXJSY7MPGIZVsfTAT85/uU9YiRJ2z8Yk+qyCGdXKqQNbCmyqkAhSjOnLVIDPT/pJwqnvB8qh/WzgmoiD3cLeZ2KImOaJzPER4awh3FNMFpgp9rR+PQgAjtofZ/Ph0NW3e3e8RSykV6t+3p48UyheH588/ekQpdSp5617Pr9ChiUDr7R0aqXWV6GUvGMiN2vuhUS9iFeY/eBocbfHQYGcOwMusfVWOjnrVuxREWcB3w== 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 CS1PR8401MB0981.NAMPRD84.PROD.OUTLOOK.COM (10.169.24.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.21; Tue, 15 Oct 2019 04:26:12 +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.2347.023; Tue, 15 Oct 2019 04:26:12 +0000 From: "Abner Chang" To: "devel@edk2.groups.io" , "Chang, Abner (HPS SW/FW Technologist)" , "leif.lindholm@linaro.org" Subject: Re: [edk2-devel] [edk2-staging/RISC-V-V2 PATCH v2 10/29] MdePkg/BasePeCoff: Add RISC-V PE/Coff related code. Thread-Topic: [edk2-devel] [edk2-staging/RISC-V-V2 PATCH v2 10/29] MdePkg/BasePeCoff: Add RISC-V PE/Coff related code. Thread-Index: AQHVcaqeUWKF6VmwtkeEFp6SO0zlaqc+pdsAgByP0jCAAAZAAA== Date: Tue, 15 Oct 2019 04:26:12 +0000 Message-ID: References: <1569198715-31552-1-git-send-email-abner.chang@hpe.com> <1569198715-31552-12-git-send-email-abner.chang@hpe.com> <20190926234620.GM25504@bivouac.eciton.net> <15CDB6324F411B37.30896@groups.io> In-Reply-To: <15CDB6324F411B37.30896@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: 90788a63-a763-4858-5ed8-08d75127cf6b x-ms-office365-filtering-ht: Tenant x-ms-traffictypediagnostic: CS1PR8401MB0981: x-ms-exchange-purlcount: 1 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1247; x-forefront-prvs: 01917B1794 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6029001)(136003)(39860400002)(366004)(376002)(346002)(396003)(199004)(189003)(13464003)(7696005)(478600001)(6506007)(229853002)(99286004)(486006)(53546011)(476003)(2501003)(11346002)(5660300002)(76176011)(446003)(316002)(110136005)(25786009)(186003)(26005)(76116006)(66066001)(6246003)(3846002)(6116002)(2906002)(102836004)(55016002)(66946007)(9686003)(52536014)(6436002)(81166006)(966005)(64756008)(66556008)(6306002)(66446008)(71200400001)(81156014)(66476007)(14454004)(8676002)(8936002)(71190400001)(74316002)(30864003)(7736002)(305945005)(86362001)(33656002)(14444005)(256004)(19627235002);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR8401MB0981;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: BCL:0; x-microsoft-antispam-message-info: unGYT6P+AfNmLtm3iLv0+b52MGLGU+8W+dK88dysb66RpUE1FFBGyMIgRBkM9/ywfcUSYhik9QKj2Gv/n8hW56lrrSH4d9MaZiUxTDZZDUgsgPQy+29t51QOB2utyaZ7tv9mEwmy8xc9hpuW8v1kXilxRPsHZGzaGsyjDCQDUHKAGEgMXdSA6G43kvqJN5/6EkIrkW3hB2r3kyE3LObXFYcxRjJW7tm4eKlVFIMxEq9Vo8oi1A8nex5XMbVFuuROgh+o6iWZKdRFx73jGxFfbVWu76vObxxlVRDR0d1AsHalDyTaVLrt8aqX0x+DLc/twLpMUm3HUZ7+YlQM+cGAusidjQiQFvAQBg9s9fzL5He19pLtiQ5GAy4/2JjVeNwB3WgTOP76luJeN2uy3B9VQU+sdgi4ZV7uw7/v4fSX7oIWL35PmtQud9iJpYK+vW1oNLb3phT4vH6FBLHbutbtfA== X-MS-Exchange-CrossTenant-Network-Message-Id: 90788a63-a763-4858-5ed8-08d75127cf6b X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2019 04:26:12.0629 (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: Q3wog/gMnJMAOtIjyPbJnpiIZqmJX2umtI41XTTmRQ35cm+vQ7l5nIP3Gb1BlpALIZjC4VB9KKWnwuvpAUNlpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR8401MB0981 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-10-15_01:2019-10-11,2019-10-15 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 mlxscore=0 suspectscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1910150040 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Abner Chang > Sent: Tuesday, October 15, 2019 12:03 PM > To: devel@edk2.groups.io; leif.lindholm@linaro.org > Subject: Re: [edk2-devel] [edk2-staging/RISC-V-V2 PATCH v2 10/29] > MdePkg/BasePeCoff: Add RISC-V PE/Coff related code. >=20 >=20 >=20 > > -----Original Message----- > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > > Leif Lindholm > > Sent: Friday, September 27, 2019 7:46 AM > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist) > > > > Subject: Re: [edk2-devel] [edk2-staging/RISC-V-V2 PATCH v2 10/29] > > MdePkg/BasePeCoff: Add RISC-V PE/Coff related code. > > > > On Mon, Sep 23, 2019 at 08:31:36AM +0800, Abner Chang wrote: > > > Support RISC-V image relocation. > > > > > > Signed-off-by: Abner Chang > > > --- > > > MdePkg/Library/BasePeCoffLib/BasePeCoff.c | 3 +- > > > MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf | 5 + > > > MdePkg/Library/BasePeCoffLib/BasePeCoffLib.uni | 2 + > > > .../Library/BasePeCoffLib/BasePeCoffLibInternals.h | 1 + > > > .../Library/BasePeCoffLib/RiscV/PeCoffLoaderEx.c | 142 > > +++++++++++++++++++++ > > > 5 files changed, 152 insertions(+), 1 deletion(-) create mode > > > 100644 MdePkg/Library/BasePeCoffLib/RiscV/PeCoffLoaderEx.c > > > > > > diff --git a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c > > > b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c > > > index 07bb62f..97e0ff4 100644 > > > --- a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c > > > +++ b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c > > > @@ -1,6 +1,6 @@ > > > /** @file > > > Base PE/COFF loader supports loading any PE32/PE32+ or TE image, > > > but > > > - only supports relocating IA32, x64, IPF, and EBC images. > > > + only supports relocating IA32, x64, IPF, ARM, RISC-V and EBC imag= es. > > > > > > Caution: This file requires additional review when modified. > > > This library will have external input - PE/COFF image. > > > @@ -17,6 +17,7 @@ > > > > > > Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved= .
> > > Portions copyright (c) 2008 - 2009, Apple Inc. All rights > > > reserved.
> > > + Portions Copyright (c) 2016, Hewlett Packard Enterprise > > > + Development LP. All rights reserved.
> > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > **/ > > > diff --git a/MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf > > > b/MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf > > > index 395c140..b190494 100644 > > > --- a/MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf > > > +++ b/MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf > > > @@ -3,6 +3,7 @@ > > > # The IPF version library supports loading IPF and EBC PE/COFF ima= ge. > > > # The IA32 version library support loading IA32, X64 and EBC > > > PE/COFF > > images. > > > # The X64 version library support loading IA32, X64 and EBC > > > PE/COFF > > images. > > > +# The RISC-V version library support loading RISC-V images. > > > # > > > # Caution: This module requires additional review when modified. > > > # This library will have external input - PE/COFF image. > > > @@ -11,6 +12,7 @@ > > > # > > > # Copyright (c) 2006 - 2018, Intel Corporation. All rights > > > reserved.
# Portions copyright (c) 2008 - 2009, Apple Inc. All > > > rights reserved.
> > > +# Copyright (c) 2016, Hewlett Packard Enterprise Development LP. > > > +All rights reserved.
> > > # > > > # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -41,6 +43,9 > > > @@ [Sources.ARM] > > > Arm/PeCoffLoaderEx.c > > > > > > +[Sources.RISCV64] > > > + RiscV/PeCoffLoaderEx.c > > > + > > > [Packages] > > > MdePkg/MdePkg.dec > > > > > > diff --git a/MdePkg/Library/BasePeCoffLib/BasePeCoffLib.uni > > > b/MdePkg/Library/BasePeCoffLib/BasePeCoffLib.uni > > > index b0ea702..8616ca3 100644 > > > --- a/MdePkg/Library/BasePeCoffLib/BasePeCoffLib.uni > > > +++ b/MdePkg/Library/BasePeCoffLib/BasePeCoffLib.uni > > > @@ -4,6 +4,7 @@ > > > // The IPF version library supports loading IPF and EBC PE/COFF ima= ge. > > > // The IA32 version library support loading IA32, X64 and EBC > > > PE/COFF > > images. > > > // The X64 version library support loading IA32, X64 and EBC > > > PE/COFF > > images. > > > +// The RISC-V version library support loading RISC-V32 and RISC-V64 > > PE/COFF images. > > > // > > > // Caution: This module requires additional review when modified. > > > // This library will have external input - PE/COFF image. > > > @@ -12,6 +13,7 @@ > > > // > > > // Copyright (c) 2006 - 2018, Intel Corporation. All rights > > > reserved.
// Portions copyright (c) 2008 - 2009, Apple Inc. All > > > rights reserved.
> > > +// Copyright (c) 2016, Hewlett Packard Enterprise Development LP. > > > +All rights reserved.
> > > // > > > // SPDX-License-Identifier: BSD-2-Clause-Patent // diff --git > > > a/MdePkg/Library/BasePeCoffLib/BasePeCoffLibInternals.h > > > b/MdePkg/Library/BasePeCoffLib/BasePeCoffLibInternals.h > > > index b74277f..9c33703 100644 > > > --- a/MdePkg/Library/BasePeCoffLib/BasePeCoffLibInternals.h > > > +++ b/MdePkg/Library/BasePeCoffLib/BasePeCoffLibInternals.h > > > @@ -2,6 +2,7 @@ > > > Declaration of internal functions in PE/COFF Lib. > > > > > > Copyright (c) 2006 - 2010, Intel Corporation. All rights > > > reserved.
> > > + Copyright (c) 2016, Hewlett Packard Enterprise Development LP. > > > + All rights reserved.
> > > > You only get to add copyright when you otherwise modify the file :) > > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > **/ > > > diff --git a/MdePkg/Library/BasePeCoffLib/RiscV/PeCoffLoaderEx.c > > > b/MdePkg/Library/BasePeCoffLib/RiscV/PeCoffLoaderEx.c > > > new file mode 100644 > > > index 0000000..8eb37f9 > > > --- /dev/null > > > +++ b/MdePkg/Library/BasePeCoffLib/RiscV/PeCoffLoaderEx.c > > > @@ -0,0 +1,142 @@ > > > +/** @file > > > + PE/Coff loader for RISC-V PE image > > > + > > > + Copyright (c) 2016, Hewlett Packard Enterprise Development LP. > > > +All rights reserved.
> > > + SPDX-License-Identifier: BSD-2-Clause-Patent **/ #include > > > +"BasePeCoffLibInternals.h" > > > +#include > > > + > > > +// > > > +// RISC-V definition. > > > +// > > > +#define RV_X(x, s, n) (((x) >> (s)) & ((1<<(n))-1)) #define > > > +RISCV_IMM_BITS 12 #define RISCV_IMM_REACH > > (1LL< > > +#define RISCV_CONST_HIGH_PART(VALUE) \ > > > + (((VALUE) + (RISCV_IMM_REACH/2)) & ~(RISCV_IMM_REACH-1)) > > > > This looked familiar, so I had a look. > > This block is copied around - it exists in: > > - BaseTools/Source/C/Common/PeCoffLoaderEx.c > > - BaseTools/Source/C/GenFw/Elf64Convert.c > > - MdePkg/Library/BasePeCoffLib/RiscV/PeCoffLoaderEx.c > > > > This needs to be moved somewhere central and included elsewhere. > > BaseTools and MdePkg unfortunately duplicate a lot of stuff, but this > > still belongs in a common header file for either. >=20 > I can consolidate that macro in two files under BaseTools, but not > consolidating macro in files in both MdePkg and BaseTools. BaseTools and > edk2 are two separate projects and could be built individually based on = my > understanding. > I have no idea how to leverage one header file from both projects and I = don't > go that far to address it. Leif, seem there is no good place and the existing header file to put this= macro unless I create a new header file under BaseTools/Source/C/Include. = I would like to keep this duplicate macro in both files rather than create = an header file in which only define this macro. Do you have good idea? >=20 > > > > > + > > > +/** > > > + Performs an RISC-V specific relocation fixup and is a no-op on > > > + other instruction sets. > > > + RISC-V splits 32-bit fixup into 20bit and 12-bit with two > > > +relocation > > > + types. We have to know the lower 12-bit fixup first then we can > > > +deal > > > + carry over on high 20-bit fixup. So we log the high 20-bit in > > > + FixupData. > > > + > > > + @param Reloc The pointer to the relocation record. > > > + @param Fixup The pointer to the address to fix up. > > > + @param FixupData The pointer to a buffer to log the fixups. > > > + @param Adjust The offset to adjust the fixup. > > > + > > > + @return Status code. > > > + > > > +**/ > > > +RETURN_STATUS > > > +PeCoffLoaderRelocateImageEx ( > > > + IN UINT16 *Reloc, > > > + IN OUT CHAR8 *Fixup, > > > + IN OUT CHAR8 **FixupData, > > > + IN UINT64 Adjust > > > + ) > > > +{ > > > + UINT32 Value; > > > + UINT32 Value2; > > > + UINT32 *RiscVHi20Fixup; > > > + > > > + switch ((*Reloc) >> 12) { > > > + case EFI_IMAGE_REL_BASED_RISCV_HI20: > > > + *(UINT64 *)(*FixupData) =3D (UINT64)(UINTN)Fixup; > > > + break; > > > + > > > + case EFI_IMAGE_REL_BASED_RISCV_LOW12I: > > > + RiscVHi20Fixup =3D (UINT32 *)(*(UINT64 *)(*FixupData)); > > > + if (RiscVHi20Fixup !=3D NULL) { > > > + > > > + Value =3D (UINT32)(RV_X(*RiscVHi20Fixup, 12, 20) << 12); > > > + Value2 =3D (UINT32)(RV_X(*(UINT32 *)Fixup, 20, 12)); > > > + if (Value2 & (RISCV_IMM_REACH/2)) { > > > + Value2 |=3D ~(RISCV_IMM_REACH-1); > > > + } > > > + Value +=3D Value2; > > > + Value +=3D (UINT32)Adjust; > > > + Value2 =3D RISCV_CONST_HIGH_PART (Value); > > > + *(UINT32 *)RiscVHi20Fixup =3D (RV_X (Value2, 12, 20) << 12)= |\ > > > + (RV_X (*(UINT32 *)RiscVH= i20Fixup, 0, 12)); > > > + *(UINT32 *)Fixup =3D (RV_X (Value, 0, 12) << 20) |\ > > > + (RV_X (*(UINT32 *)Fixup, 0, 20)); > > > + } > > > + break; > > > + > > > + case EFI_IMAGE_REL_BASED_RISCV_LOW12S: > > > + RiscVHi20Fixup =3D (UINT32 *)(*(UINT64 *)(*FixupData)); > > > + if (RiscVHi20Fixup !=3D NULL) { > > > + Value =3D (UINT32)(RV_X(*RiscVHi20Fixup, 12, 20) << 12); > > > + Value2 =3D (UINT32)(RV_X(*(UINT32 *)Fixup, 7, 5) | > > > + (RV_X(*(UINT32 > > *)Fixup, 25, 7) << 5)); > > > + if (Value2 & (RISCV_IMM_REACH/2)) { > > > + Value2 |=3D ~(RISCV_IMM_REACH-1); > > > + } > > > + Value +=3D Value2; > > > + Value +=3D (UINT32)Adjust; > > > + Value2 =3D RISCV_CONST_HIGH_PART (Value); > > > + *(UINT32 *)RiscVHi20Fixup =3D (RV_X (Value2, 12, 20) << 12)= | \ > > > + (RV_X (*(UINT32 *)RiscVH= i20Fixup, 0, 12)); > > > + Value2 =3D *(UINT32 *)Fixup & 0x01fff07f; > > > + Value &=3D RISCV_IMM_REACH - 1; > > > + *(UINT32 *)Fixup =3D Value2 | (UINT32)(((RV_X(Value, 0, 5) = << > > > + 7) | > > (RV_X(Value, 5, 7) << 25))); > > > + } > > > + break; > > > + > > > + default: > > > + return RETURN_UNSUPPORTED; > > > + > > > + } > > > + return RETURN_SUCCESS; > > > +} > > > + > > > +/** > > > + Returns TRUE if the machine type of PE/COFF image is supported. > > > +Supported > > > + does not mean the image can be executed it means the PE/COFF > > > +loader supports > > > + loading and relocating of the image type. It's up to the caller > > > +to support > > > + the entry point. > > > + > > > + @param Machine Machine type from the PE Header. > > > + > > > + @return TRUE if this PE/COFF loader can load the image > > > + > > > +**/ > > > +BOOLEAN > > > +PeCoffLoaderImageFormatSupported ( > > > + IN UINT16 Machine > > > + ) > > > +{ > > > + if ((Machine =3D=3D IMAGE_FILE_MACHINE_RISCV32) || (Machine =3D= =3D > > > +IMAGE_FILE_MACHINE_RISCV64)) { > > > > RISCV32 is not supported by this set. > > > > / > > Leif > > > > > + return TRUE; > > > + } > > > + > > > + return FALSE; > > > +} > > > + > > > +/** > > > + Performs an Itanium-based specific re-relocation fixup and is a > > > +no-op on other > > > + instruction sets. This is used to re-relocated the image into the > > > +EFI virtual > > > + space for runtime calls. > > > + > > > + @param Reloc The pointer to the relocation record. > > > + @param Fixup The pointer to the address to fix up. > > > + @param FixupData The pointer to a buffer to log the fixups. > > > + @param Adjust The offset to adjust the fixup. > > > + > > > + @return Status code. > > > + > > > +**/ > > > +RETURN_STATUS > > > +PeHotRelocateImageEx ( > > > + IN UINT16 *Reloc, > > > + IN OUT CHAR8 *Fixup, > > > + IN OUT CHAR8 **FixupData, > > > + IN UINT64 Adjust > > > + ) > > > +{ > > > + return RETURN_UNSUPPORTED; > > > +} > > > -- > > > 2.7.4 > > > > > > > > > > > > > > > > >=20 >=20 >=20