From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web12.3808.1587450726226665390 for ; Mon, 20 Apr 2020 23:32:06 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ptqOpmQk; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: zhiguang.liu@intel.com) IronPort-SDR: KMQmIhE50JzscTr4X212bGMeucDghHP3f2A5UrJGHmLHDlRU0dwVKicAKQ/WdcAeqere9eOfYV 2bYpxfHRcL+g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2020 23:32:05 -0700 IronPort-SDR: 8yXyXUyxqzxcWEYanIFv7IPXTWxIwrY7JC5jIhhZBnuBvhI4NXf3bBsxiQCo/bvnLSwYUgMPy0 6Sjd/URNSM7g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,409,1580803200"; d="scan'208";a="291505249" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by orsmga008.jf.intel.com with ESMTP; 20 Apr 2020 23:32:05 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Apr 2020 23:32:05 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Apr 2020 23:32:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hyrnvJnlkTXMGHe4cgpfNJfpfO5QS0VpTFkxLfs+pQ50PlSrIpR/pXFhjtfIJBbY30C86JBCWAc/y1HTZmkzjHqxJqoWdSQWFD+HTqtgGJsxhZcW5WKeCvDDDx0Um5ER0Tjl4qGrK1Aml9xm40Ea6mh+XX0qHHwBboDQVUqj5BY7Wv2u6yyeusvN96zAociHpPMfAxREVWCXwcG+xtRJS4d2vnah5JdI1x+7aBOtiXK8trdhJC1SFyTsrvufLE1YEuL4lLuTKpjg1kr8dyQRNCTWMkaF+PyMjmmvsuQpb/TYOArZqNnHEWe2jkJakKqtgzUHOa3womiABRHtYv9lQQ== 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=dq0RssDhSGPi+2LEtGrChO+2NCgFONzEb/EiE7CZOj8=; b=k3JeAWQLjyIQCBkyZt9mfoZpdDkDszz5VuFBHZGzZORc+xFFC0m/9kcbjclRKcO4VIrvUQQVnzQ5aQRpJMSJ36XAYXe9whJQjyOJ7QyvbGRPik4+oPVUgcgl7eh26St6LobtqmrGy2JB8HI06WAeuVLUSzbucQ7lylxTPgjdDlURTfa0re3B52gzxKI51q9RRWpCwwn5chwRVDYhzFvXXLwmIPg89PhT4h7SbyFb/50iwEZWXlqFrw8E5sQsT/0XKkLDEtbCJI7UdGdXE3X7qyiR+dpj3tUBp7Bo0d1ZRZuOp+WyIDaxsxYdQ3uuLGFyvJeHOLqhEFZLO9WE/0dRvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dq0RssDhSGPi+2LEtGrChO+2NCgFONzEb/EiE7CZOj8=; b=ptqOpmQk7dplANeJLw1PgSrCP5Xl0wjM/VydD/0mqq2NKCTJQYzeUHWcXrqsaRAx8HpAbTzT62AbVtyHihohD7YU0uE9wg7B+A3vka9wp2yyht7uOiGqrdB1XOMMdlZhrsZ0iHKsfTV/fzO5oBSmE25h3Xe7sPkMt2RfM/f9NnU= Received: from BN7PR11MB2804.namprd11.prod.outlook.com (2603:10b6:406:ac::12) by BN7PR11MB2722.namprd11.prod.outlook.com (2603:10b6:406:b8::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.26; Tue, 21 Apr 2020 06:32:04 +0000 Received: from BN7PR11MB2804.namprd11.prod.outlook.com ([fe80::79e2:ed1f:4d6b:532c]) by BN7PR11MB2804.namprd11.prod.outlook.com ([fe80::79e2:ed1f:4d6b:532c%7]) with mapi id 15.20.2921.030; Tue, 21 Apr 2020 06:32:04 +0000 From: "Zhiguang Liu" To: "devel@edk2.groups.io" , "abner.chang@hpe.com" CC: Gilbert Chen , Leif Lindholm , "Kinney, Michael D" , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH v1 2/9] MdePkg/Include: RISC-V definitions. Thread-Topic: [edk2-devel] [PATCH v1 2/9] MdePkg/Include: RISC-V definitions. Thread-Index: AQHWDw3xlJtSBzAu60+LDh0yVwZ0T6iDLwIQ Date: Tue, 21 Apr 2020 06:32:03 +0000 Message-ID: References: <20200410072112.7310-1-abner.chang@hpe.com> <20200410072112.7310-3-abner.chang@hpe.com> In-Reply-To: <20200410072112.7310-3-abner.chang@hpe.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiguang.liu@intel.com; x-originating-ip: [192.102.204.36] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d94a56f4-235d-40bd-5f92-08d7e5bdb4d4 x-ms-traffictypediagnostic: BN7PR11MB2722: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:608; x-forefront-prvs: 038002787A x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN7PR11MB2804.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10019020)(396003)(366004)(376002)(39860400002)(136003)(346002)(4326008)(316002)(55016002)(110136005)(53546011)(9686003)(26005)(2906002)(5660300002)(6506007)(86362001)(107886003)(54906003)(7696005)(81156014)(8936002)(186003)(76116006)(52536014)(71200400001)(33656002)(966005)(478600001)(66946007)(66446008)(66476007)(64756008)(66556008)(8676002);DIR:OUT;SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: qtboHxkKbtX++kopPKSTpBifSWuVgzBygbh2TDHsJmw2hba872zMRfgAIzUsF+6A6Ipekhf83cPBfOkIc8ypoiadGAqads9YUfXpEAOLzmE0Z2czP0rmx5OaUcdANUauPDJcNRRHX7MWsJOYeQu7zqO+AdFFJyfuxcyJ/qk+K8EMHeFxivdJbtoMdFWkEu4xYJ2SZbRazoAGUgoRdTU8+ycTcyN4NW1NH5TGIIee/9Nxc2qOO2C/Vlj35kumdnXUU/WS4BhJQo5T4orqyhOoAbfKgbPr1zFba7ekrAsnjzvly0xfNjkFLjATWJztBqYeNVPWVTlSvJDKVygAlKRAL1EUazJpMUlZjZoOSXQsIra1JBTfaD3HuVdcOfz7HmaaWqJN4ntv+Tv3hYZ5rIiTj1c0nw8d6fE2lHsbfy3mOdbuLvX6ADXoh+AATGo2mE4r5ZnHNM9cOGKBECoafScA7SAdMLZOCj1nzcaOHKWdjtTLFSMNkmiSYJzC/3EahMpAHlqsPd2Nh/FhRw/Q19jN1A== x-ms-exchange-antispam-messagedata: HlUUOl6LzO+eyC2Us5Wr+UzfCy9AsT8z70/IVkhb7f0uO5Y8b5f/kqBp4PoK4IMXuedNPHu+B1I+IbhCxZfJIxkqT4MbNcbbZN5WM17u/cyBP5xju4lODSQg1u9p1Fn1cAJZm6PvVogBfbK+XZjGKw== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d94a56f4-235d-40bd-5f92-08d7e5bdb4d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Apr 2020 06:32:03.9432 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: OB2IwvqAdMmbrJVg+lz8nZ+XLmNchV5ufEpVQm3fdw4REW7XcP7GWZDQQQfIo9yGVnkdVrAuNuhyCdPvZgHezQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2722 Return-Path: zhiguang.liu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Zhiguang Liu -----Original Message----- From: devel@edk2.groups.io On Behalf Of Abner Chang Sent: Friday, April 10, 2020 3:21 PM To: devel@edk2.groups.io Cc: abner.chang@hpe.com; Gilbert Chen ; Leif Lindholm= ; Kinney, Michael D = ; Gao, Liming Subject: [edk2-devel] [PATCH v1 2/9] MdePkg/Include: RISC-V definitions. Add RISC-V processor related definitions. Signed-off-by: Abner Chang Co-authored-by: Gilbert Chen Reviewed-by: Leif Lindholm Cc: Michael D Kinney Cc: Liming Gao Cc: Leif Lindholm Cc: Gilbert Chen --- MdePkg/Include/IndustryStandard/PeImage.h | 12 +++++ MdePkg/Include/Protocol/DebugSupport.h | 55 +++++++++++++++++++++++ MdePkg/Include/Protocol/PxeBaseCode.h | 4 ++ MdePkg/Include/Uefi/UefiBaseType.h | 13 ++++++ MdePkg/Include/Uefi/UefiSpec.h | 5 +++ 5 files changed, 89 insertions(+) diff --git a/MdePkg/Include/IndustryStandard/PeImage.h b/MdePkg/Include/Ind= ustryStandard/PeImage.h index a3d9bbed75..9b267002a1 100644 --- a/MdePkg/Include/IndustryStandard/PeImage.h +++ b/MdePkg/Include/IndustryStandard/PeImage.h @@ -9,6 +9,8 @@ =20 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
+Portions Copyright (c) 2016 - 2020, Hewlett Packard Enterprise Development= LP. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -34,6 +36,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define IMAGE_FILE_MACHINE_X64 0x8664 #define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED 0x01c2 #define IMAGE_FILE_MACHINE_ARM64 0xAA64 +#define IMAGE_FILE_MACHINE_RISCV32 0x5032 +#define IMAGE_FILE_MACHINE_RISCV64 0x5064 +#define IMAGE_FILE_MACHINE_RISCV128 0x5128 =20 // // EXE file formats @@ -493,6 +498,13 @@ typedef struct { #define EFI_IMAGE_REL_BASED_MIPS_JMPADDR16 9 #define EFI_IMAGE_REL_BASED_DIR64 10 =20 +/// +/// Relocation types of RISC-V processor. +/// +#define EFI_IMAGE_REL_BASED_RISCV_HI20 5 +#define EFI_IMAGE_REL_BASED_RISCV_LOW12I 7 +#define EFI_IMAGE_REL_BASED_RISCV_LOW12S 8 + /// /// Line number format. /// diff --git a/MdePkg/Include/Protocol/DebugSupport.h b/MdePkg/Include/Protoc= ol/DebugSupport.h index 800e7710e6..7fb1d3b3e4 100644 --- a/MdePkg/Include/Protocol/DebugSupport.h +++ b/MdePkg/Include/Protocol/DebugSupport.h @@ -7,6 +7,7 @@ =20 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
+Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights = reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -603,6 +604,59 @@ typedef struct { UINT64 FAR; // Fault Address Register } EFI_SYSTEM_CONTEXT_AARCH64; =20 +/// +/// RISC-V processor exception types. +/// +#define EXCEPT_RISCV_INST_MISALIGNED 0 +#define EXCEPT_RISCV_INST_ACCESS_FAULT 1 +#define EXCEPT_RISCV_ILLEGAL_INST 2 +#define EXCEPT_RISCV_BREAKPOINT 3 +#define EXCEPT_RISCV_LOAD_ADDRESS_MISALIGNED 4 +#define EXCEPT_RISCV_LOAD_ACCESS_FAULT 5 +#define EXCEPT_RISCV_STORE_AMO_ADDRESS_MISALIGNED 6 +#define EXCEPT_RISCV_STORE_AMO_ACCESS_FAULT 7 +#define EXCEPT_RISCV_ENV_CALL_FROM_UMODE 8 +#define EXCEPT_RISCV_ENV_CALL_FROM_SMODE 9 +#define EXCEPT_RISCV_ENV_CALL_FROM_HMODE 10 +#define EXCEPT_RISCV_ENV_CALL_FROM_MMODE 11 + +#define EXCEPT_RISCV_SOFTWARE_INT 0x0 +#define EXCEPT_RISCV_TIMER_INT 0x1 + +typedef struct { + UINT64 X0; + UINT64 X1; + UINT64 X2; + UINT64 X3; + UINT64 X4; + UINT64 X5; + UINT64 X6; + UINT64 X7; + UINT64 X8; + UINT64 X9; + UINT64 X10; + UINT64 X11; + UINT64 X12; + UINT64 X13; + UINT64 X14; + UINT64 X15; + UINT64 X16; + UINT64 X17; + UINT64 X18; + UINT64 X19; + UINT64 X20; + UINT64 X21; + UINT64 X22; + UINT64 X23; + UINT64 X24; + UINT64 X25; + UINT64 X26; + UINT64 X27; + UINT64 X28; + UINT64 X29; + UINT64 X30; + UINT64 X31; +} EFI_SYSTEM_CONTEXT_RISCV64; =20 /// /// Universal EFI_SYSTEM_CONTEXT definition. @@ -614,6 +668,7 @@ typedef union { EFI_SYSTEM_CONTEXT_IPF *SystemContextIpf; EFI_SYSTEM_CONTEXT_ARM *SystemContextArm; EFI_SYSTEM_CONTEXT_AARCH64 *SystemContextAArch64; + EFI_SYSTEM_CONTEXT_RISCV64 *SystemContextRiscV64; } EFI_SYSTEM_CONTEXT; =20 // diff --git a/MdePkg/Include/Protocol/PxeBaseCode.h b/MdePkg/Include/Protoco= l/PxeBaseCode.h index b02d270134..c666d312b5 100644 --- a/MdePkg/Include/Protocol/PxeBaseCode.h +++ b/MdePkg/Include/Protocol/PxeBaseCode.h @@ -3,6 +3,8 @@ devices for network access and network booting. =20 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights = reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Revision Reference: @@ -153,6 +155,8 @@ typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT; #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x000A #elif defined (MDE_CPU_AARCH64) #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x000B +#elif defined (MDE_CPU_RISCV64) +#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x001B #endif =20 =20 diff --git a/MdePkg/Include/Uefi/UefiBaseType.h b/MdePkg/Include/Uefi/UefiB= aseType.h index a62f13dd06..934fc07285 100644 --- a/MdePkg/Include/Uefi/UefiBaseType.h +++ b/MdePkg/Include/Uefi/UefiBaseType.h @@ -3,6 +3,7 @@ =20 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
Portions copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.
+Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights = reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -240,6 +241,12 @@ typedef union { /// #define EFI_IMAGE_MACHINE_AARCH64 0xAA64 =20 +/// +/// PE32+ Machine type for RISC-V 32/64/128 +/// +#define EFI_IMAGE_MACHINE_RISCV32 0x5032 +#define EFI_IMAGE_MACHINE_RISCV64 0x5064 +#define EFI_IMAGE_MACHINE_RISCV128 0x5128 =20 #if defined (MDE_CPU_IA32) =20 @@ -268,6 +275,12 @@ typedef union { =20 #define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE) =20 +#elif defined (MDE_CPU_RISCV64) +#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \ + ((Machine) =3D=3D EFI_IMAGE_MACHINE_RISCV64) + +#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE) + #elif defined (MDE_CPU_EBC) =20 /// diff --git a/MdePkg/Include/Uefi/UefiSpec.h b/MdePkg/Include/Uefi/UefiSpec.= h index 444aa35eca..8ffaf97515 100644 --- a/MdePkg/Include/Uefi/UefiSpec.h +++ b/MdePkg/Include/Uefi/UefiSpec.h @@ -6,6 +6,8 @@ by this include file. =20 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. Al= l rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -2198,6 +2200,7 @@ typedef struct { #define EFI_REMOVABLE_MEDIA_FILE_NAME_X64 L"\\EFI\\BOOT\\BOOTX64.EFI" #define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM L"\\EFI\\BOOT\\BOOTARM.EFI" #define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64 L"\\EFI\\BOOT\\BOOTAA64.EFI" +#define EFI_REMOVABLE_MEDIA_FILE_NAME_RISCV64 L"\\EFI\\BOOT\\BOOTRISCV64.E= FI" =20 #if defined (MDE_CPU_IA32) #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA= 32 @@ -2208,6 +2211,8 @@ typedef struct { #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_AR= M #elif defined (MDE_CPU_AARCH64) #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_AA= RCH64 +#elif defined (MDE_CPU_RISCV64) + #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_RI= SCV64 #else #error Unknown Processor Type #endif --=20 2.25.0 -=3D-=3D-=3D-=3D-=3D-=3D Groups.io Links: You receive all messages sent to this group. View/Reply Online (#57193): https://edk2.groups.io/g/devel/message/57193 Mute This Topic: https://groups.io/mt/72916360/1779286 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [zhiguang.liu@intel.com] -=3D-=3D-=3D-=3D-=3D-=3D