From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web10.17892.1600956831778300535 for ; Thu, 24 Sep 2020 07:13:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=YoOrkhnp; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=053645c725=abner.chang@hpe.com) Received: from pps.filterd (m0134420.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08OE8fIP024121; Thu, 24 Sep 2020 14:13:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pps0720; bh=HCL4mZgLvbG72y7PMU59uxO0tfrcLWe5uiz3Zse74rs=; b=YoOrkhnpfSjfdE1ldu3VGcJax2ZNLwHy1TJnh5hRV/Y0z89Ju6AMRlzl9wQK86o8qVDM SsGja/ejvs23Pa7lL1+/USkBMuqkLfXJi5qHZ1Y1fwB2lW9DD45aI83ZSBdZItecukKb zikh8YVmmADNzmx1BYQxYJTtQoLBOrAe+JjpTMTJ1n9la45KNN2ILeV7ctboTmExOav8 ZlDCnqmwtbWukV/OcBcvV5SXr8epmn4K/MmL0O4E2ADmsHCYvv4Wo4jBWkdvHYxnbvH6 5NAc0rZsIWOG+udZpfqjI59SsASiqc2mvyvxyrc7nhHozJjpWBAllQxx3QmCKCe3dqE2 /Q== Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) by mx0b-002e3701.pphosted.com with ESMTP id 33rs7h9wbp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2020 14:13:51 +0000 Received: from G1W8108.americas.hpqcorp.net (g1w8108.austin.hp.com [16.193.72.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3425.houston.hpe.com (Postfix) with ESMTPS id 2E1A792; Thu, 24 Sep 2020 14:13:49 +0000 (UTC) Received: from G1W8107.americas.hpqcorp.net (2002:10c1:483b::10c1:483b) by G1W8108.americas.hpqcorp.net (2002:10c1:483c::10c1:483c) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 24 Sep 2020 14:13:49 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.241.52.10) by G1W8107.americas.hpqcorp.net (16.193.72.59) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Thu, 24 Sep 2020 14:13:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LXKTf+kdpt905b1sdejEJKoXzDO3fIMBGzJUQrBrrz/bh34RgAXS9WJbjCQaUmzyw+uNtuPFSVrI5IRRLdQ4lpMZErareiNGE6vyV5xKMsQLOlpudwtl41DQMZqW3YkrTRdyQ9jOJwSMkVbe95ySDYdylrOgvvoyIvmHAYY0sSrlJQZEI2kmOWdr1MXhPk2pNSQ3TFpSdiBg6nx0xZw02tSX9Y4KZT0iOHYYRG1Z12uo6IwzUF3UvQ6p4XZZcyyqWibENijlIp95g4Zhvnfpmf/EL0mPRJOlmrnrfIY1To0xCvZ/X7YKS9Ft39WgB9EoXVM1zLEs8lbYw0r3KV8XOw== 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=tYzck3IqfJPQh5e939E7N2xpMLGzl4KUHy8t8CV4MA8=; b=P3swvmcOp4ZKbkeq4hZB6oUs+Uj5LuV2ESvYIg/bd9D1xMzLFY/ROtjx5T9K+0orNo/rSFxycR+qhQSwuX0DifOWbc3fPXRVtTYhVJXjeVQCO0s+Uye5AZe201vu6Gi3k8HYnagJzKYhk1LnCIydhWUyLoz4wtxTDUsfEfbDrzruIIkYjEh5Vm5GGpFDjtPSTaWM/laQp9zpVet1StLO+St2t8cA7wW1ecpGte2Fkjg9DCuGUBkO1CsJGkTuZ/2Lf1AHg0087xMRaxhWtfu3x21vkXWqBuX7u4yzT74Y7f5rvLa5B007Fys2RWqIeRdKH8Psztk7TfDw/PQCHItUJQ== 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 CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7508::16) by CS1PR8401MB0999.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:750f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.21; Thu, 24 Sep 2020 14:13:48 +0000 Received: from CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM ([fe80::d111:132b:4b87:a9ea]) by CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM ([fe80::d111:132b:4b87:a9ea%3]) with mapi id 15.20.3391.027; Thu, 24 Sep 2020 14:13:47 +0000 From: "Abner Chang" To: "devel@edk2.groups.io" , "sh1r4s3@mail.si-head.nl" Subject: Re: [edk2-devel] [PATCH] BaseTools: Add RISCV64 binding Thread-Topic: [edk2-devel] [PATCH] BaseTools: Add RISCV64 binding Thread-Index: AQHWkNiBhqIQkqx8M0a0EFAadXpgOKl31zjw Date: Thu, 24 Sep 2020 14:13:47 +0000 Message-ID: References: <20200922103824.27161-1-sh1r4s3@mail.si-head.nl> In-Reply-To: <20200922103824.27161-1-sh1r4s3@mail.si-head.nl> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=hpe.com; x-originating-ip: [1.34.113.40] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 29590a75-416a-4831-4d4e-08d860940e04 x-ms-traffictypediagnostic: CS1PR8401MB0999: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:422; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: T1VyPcD46OrsPg5+QpPYdp7b60kBu/M9DuzK58PtA3HHK9tB0zWTmYXbn64h4VJ02FCbwQ+qwXDT4ZsjpH+Ygur1qZB2sCMS3C6feqMQ4vl4MuZQHUNsyztYxx59i/JbFoXcMrx4aOo8WEPhswTioGhO0frq4OfoUM9E1f4/ZbJXPOZjwT7OY9H1EWs71JJi43/OvYNmHTw/a5LyexPVuFWjA46wNF682zbcp4I5nyVsqDE74e1EBuu6H+FL/bLD/QDEiNsCpz/J/8iWw2sHtpAo/zLywVCEaVVpj9uBy8rO0qs1mKScVPKIJSceXnKjcR0C5DjVOssthMymKIfMdgm2dSdgh6OhdJ3cq/mQyq0mGj8XzW1peX2qkXF35VYHpCLL2ylHT72DyXZtDoYTUw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(346002)(396003)(39860400002)(376002)(136003)(366004)(71200400001)(66476007)(66556008)(53546011)(64756008)(66446008)(186003)(2906002)(66946007)(76116006)(6506007)(83380400001)(55016002)(86362001)(19627235002)(5660300002)(478600001)(33656002)(966005)(52536014)(9686003)(316002)(8676002)(8936002)(7696005)(26005)(110136005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: 80CE0oCrIQdJ+rr8AeiXRt97KjMMyEpzbS0v3qOMIgFuca39yJPV3NyHg8PZB3IT/7HrCU/plCp5s+UFY4ZqO7UoC4bE7NoH+ZB1lroRTvGQkW29nuoPb+HznCcpijpt2Zk33Tzn2Z3K6qodAgpKXoqPU0sFDBr3GJVh3GuJ8BB0aMedGrTpr9VLjoEdc/qMt6CKfq0W/tCSxpa/RGWK1AbkY5l4T9RTF5v9p6iGsT1dAuxCtt7sspH8SK/ndVtrWA4gNCdBIKAivfgrXh9mapT4Z0uWi2i6wncNJecPEFwhUXu4JcwWBgXo0yXZJhDV0l7y/HShxNBQSWvL0V95r/7vGtAH5Df2MTrqPqVk1T5GqPpt7DtYqaawDmbPdc6g036MYu0EkORqvkMbAgTjOe/tlkk38Nwu5Z/dHiKZeeh+3PPsqHDcO0t78HutSLl+qQKztDsCEmWUlzs7WoQaT8tutDvZ6GmuKv0zZtiArNtvt0MOH2wXY7vDX/jAG3T9gn6V3eZHcMWaTYVJ3dTL54rmE2ja+ugxuMGzq79nLm0qyYPTymFtB9YWYfjWRNUvdB/I3fg+ZpteEf6rEf1jowXCjrTuhiKiomowKYH7YKs45y5AqTWkCv96gSrMU68kOAlafZ/U/sQIyAH04vY3qA== x-ms-exchange-transport-forked: True X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 29590a75-416a-4831-4d4e-08d860940e04 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Sep 2020 14:13:47.8544 (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: m8uG4ckIxGsBTMSdgi2zUevLgC4tXn0XT6GPmabHTKMkHMEMRCmOYNKZ/qYUEtuT2ZxbJP/83nOCVdLJ2vRM+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR8401MB0999 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.235,18.0.687 definitions=2020-09-24_08:2020-09-24,2020-09-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 clxscore=1011 priorityscore=1501 spamscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 mlxlogscore=963 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009240107 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Acked-by: Abner Chang > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Nikita > Sent: Tuesday, September 22, 2020 6:38 PM > To: devel@edk2.groups.io > Cc: Nikita Ermakov > Subject: [edk2-devel] [PATCH] BaseTools: Add RISCV64 binding >=20 > - Add RISCV64 ProcessorBind.h >=20 > - Add RISCV64 to Makefiles >=20 > Signed-off-by: Nikita Ermakov > --- > BaseTools/Source/C/GNUmakefile | 3 + > .../Source/C/Include/RiscV64/ProcessorBind.h | 85 +++++++++++++++++++ > BaseTools/Source/C/Makefiles/header.makefile | 6 ++ > 3 files changed, 94 insertions(+) > create mode 100644 BaseTools/Source/C/Include/RiscV64/ProcessorBind.h >=20 > diff --git a/BaseTools/Source/C/GNUmakefile > b/BaseTools/Source/C/GNUmakefile index df4eb64ea9..464f432774 100644 > --- a/BaseTools/Source/C/GNUmakefile > +++ b/BaseTools/Source/C/GNUmakefile > @@ -26,6 +26,9 @@ ifndef HOST_ARCH > else ifneq (,$(findstring arm,$(uname_m))) > HOST_ARCH=3DARM > endif > + ifneq (,$(findstring riscv64,$(uname_m))) > + HOST_ARCH=3DRISCV64 > + endif > ifndef HOST_ARCH > $(info Could not detected HOST_ARCH from uname results) > $(error HOST_ARCH is not defined!) > diff --git a/BaseTools/Source/C/Include/RiscV64/ProcessorBind.h > b/BaseTools/Source/C/Include/RiscV64/ProcessorBind.h > new file mode 100644 > index 0000000000..1612d6ea7f > --- /dev/null > +++ b/BaseTools/Source/C/Include/RiscV64/ProcessorBind.h > @@ -0,0 +1,85 @@ > +/** @file > + Processor or Compiler specific defines and types for RISC-V. > + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef __PROCESSOR_BIND_H__ > +#define __PROCESSOR_BIND_H__ > + > +// > +// Define the processor type so other code can make processor based > +choices // #define MDE_CPU_RISCV64 > + > +// > +// Make sure we are using the correct packing rules per EFI > +specification // #ifndef __GNUC__ #pragma pack() #endif > + > +// > +// Use ANSI C 2000 stdint.h integer width declarations // #include > + > +typedef uint8_t BOOLEAN; > +typedef int8_t INT8; > +typedef uint8_t UINT8; > +typedef int16_t INT16; > +typedef uint16_t UINT16; > +typedef int32_t INT32; > +typedef uint32_t UINT32; > +typedef int64_t INT64; > +typedef uint64_t UINT64; > +typedef char CHAR8; > +typedef uint16_t CHAR16; > + > +// > +// Unsigned value of native width. (4 bytes on supported 32-bit > +processor instructions, // 8 bytes on supported 64-bit processor > +instructions) // typedef UINT64 UINTN; > + > +// > +// Signed value of native width. (4 bytes on supported 32-bit > +processor instructions, // 8 bytes on supported 64-bit processor > +instructions) // > +typedef INT64 INTN; > + > +// > +// Processor specific defines > +// > + > +// > +// A value of native width with the highest bit set. > +// > +#define MAX_BIT 0x8000000000000000 > + > +// > +// A value of native width with the two highest bits set. > +// > +#define MAX_2_BITS 0xC000000000000000 > + > +// > +// The stack alignment required for RISC-V // #define > +CPU_STACK_ALIGNMENT 16 > + > +// > +// Modifier to ensure that all protocol member functions and EFI > +intrinsics // use the correct C calling convention. All protocol member > +functions and // EFI intrinsics are required to modify their member > functions with EFIAPI. > +// > +#define EFIAPI > + > +#if defined(__GNUC__) > + // > + // For GNU assembly code, .global or .globl can declare global symbol= s. > + // Define this macro to unify the usage. > + // > + #define ASM_GLOBAL .globl > +#endif > + > +#endif > diff --git a/BaseTools/Source/C/Makefiles/header.makefile > b/BaseTools/Source/C/Makefiles/header.makefile > index 1c105ee7d4..0df728f327 100644 > --- a/BaseTools/Source/C/Makefiles/header.makefile > +++ b/BaseTools/Source/C/Makefiles/header.makefile > @@ -28,6 +28,9 @@ ifndef HOST_ARCH > else ifneq (,$(findstring arm,$(uname_m))) > HOST_ARCH=3DARM > endif > + ifneq (,$(findstring riscv64,$(uname_m))) > + HOST_ARCH=3DRISCV64 > + endif > ifndef HOST_ARCH > $(info Could not detected HOST_ARCH from uname results) > $(error HOST_ARCH is not defined!) > @@ -64,6 +67,9 @@ ARCH_INCLUDE =3D -I $(MAKEROOT)/Include/Arm/ else > ifeq ($(HOST_ARCH), AARCH64) ARCH_INCLUDE =3D -I > $(MAKEROOT)/Include/AArch64/ >=20 > +else ifeq ($(HOST_ARCH), RISCV64) > +ARCH_INCLUDE =3D -I $(MAKEROOT)/Include/RiscV64/ > + > else > $(error Bad HOST_ARCH) > endif > -- > 2.28.0 >=20 >=20 >=20 >=20 >=20