From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web11.7911.1600916961705537083 for ; Wed, 23 Sep 2020 20:09:22 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Thu, 24 Sep 2020 11:09:16 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , References: <20200922103824.27161-1-sh1r4s3@mail.si-head.nl> In-Reply-To: <20200922103824.27161-1-sh1r4s3@mail.si-head.nl> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIXSBCYXNlVG9vbHM6IEFkZCBSSVNDVjY0IGJpbmRpbmc=?= Date: Thu, 24 Sep 2020 11:09:19 +0800 Message-ID: <005601d69220$183edcb0$48bc9610$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQLhp3mC8Q+sZSuHSz4Fi4fZkRbSy6dg8TIA Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Ack-by: Liming Gao > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: bounce+27952+65443+4905953+8761045@groups.io > =B4=FA=B1=ED Nikita > =B7=A2=CB=CD=CA=B1=BC=E4: 2020=C4=EA9=D4=C222=C8=D5 18:38 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Nikita Ermakov > =D6=F7=CC=E2: [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))) >=20 > HOST_ARCH=3DARM >=20 > endif >=20 > + ifneq (,$(findstring riscv64,$(uname_m))) >=20 > + HOST_ARCH=3DRISCV64 >=20 > + endif >=20 > ifndef HOST_ARCH >=20 > $(info Could not detected HOST_ARCH from uname results) >=20 > $(error HOST_ARCH is not defined!) >=20 > 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 >=20 > + Processor or Compiler specific defines and types for RISC-V. >=20 > + >=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#ifndef __PROCESSOR_BIND_H__ >=20 > +#define __PROCESSOR_BIND_H__ >=20 > + >=20 > +// >=20 > +// Define the processor type so other code can make processor based > choices >=20 > +// >=20 > +#define MDE_CPU_RISCV64 >=20 > + >=20 > +// >=20 > +// Make sure we are using the correct packing rules per EFI = specification >=20 > +// >=20 > +#ifndef __GNUC__ >=20 > +#pragma pack() >=20 > +#endif >=20 > + >=20 > +// >=20 > +// Use ANSI C 2000 stdint.h integer width declarations >=20 > +// >=20 > +#include >=20 > +typedef uint8_t BOOLEAN; >=20 > +typedef int8_t INT8; >=20 > +typedef uint8_t UINT8; >=20 > +typedef int16_t INT16; >=20 > +typedef uint16_t UINT16; >=20 > +typedef int32_t INT32; >=20 > +typedef uint32_t UINT32; >=20 > +typedef int64_t INT64; >=20 > +typedef uint64_t UINT64; >=20 > +typedef char CHAR8; >=20 > +typedef uint16_t CHAR16; >=20 > + >=20 > +// >=20 > +// Unsigned value of native width. (4 bytes on supported 32-bit processor > instructions, >=20 > +// 8 bytes on supported 64-bit processor instructions) >=20 > +// >=20 > +typedef UINT64 UINTN; >=20 > + >=20 > +// >=20 > +// Signed value of native width. (4 bytes on supported 32-bit = processor > instructions, >=20 > +// 8 bytes on supported 64-bit processor instructions) >=20 > +// >=20 > +typedef INT64 INTN; >=20 > + >=20 > +// >=20 > +// Processor specific defines >=20 > +// >=20 > + >=20 > +// >=20 > +// A value of native width with the highest bit set. >=20 > +// >=20 > +#define MAX_BIT 0x8000000000000000 >=20 > + >=20 > +// >=20 > +// A value of native width with the two highest bits set. >=20 > +// >=20 > +#define MAX_2_BITS 0xC000000000000000 >=20 > + >=20 > +// >=20 > +// The stack alignment required for RISC-V >=20 > +// >=20 > +#define CPU_STACK_ALIGNMENT 16 >=20 > + >=20 > +// >=20 > +// Modifier to ensure that all protocol member functions and EFI intrinsics >=20 > +// use the correct C calling convention. All protocol member = functions and >=20 > +// EFI intrinsics are required to modify their member functions with EFIAPI. >=20 > +// >=20 > +#define EFIAPI >=20 > + >=20 > +#if defined(__GNUC__) >=20 > + // >=20 > + // For GNU assembly code, .global or .globl can declare global = symbols. >=20 > + // Define this macro to unify the usage. >=20 > + // >=20 > + #define ASM_GLOBAL .globl >=20 > +#endif >=20 > + >=20 > +#endif >=20 > 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))) >=20 > HOST_ARCH=3DARM >=20 > endif >=20 > + ifneq (,$(findstring riscv64,$(uname_m))) >=20 > + HOST_ARCH=3DRISCV64 >=20 > + endif >=20 > ifndef HOST_ARCH >=20 > $(info Could not detected HOST_ARCH from uname results) >=20 > $(error HOST_ARCH is not defined!) >=20 > @@ -64,6 +67,9 @@ ARCH_INCLUDE =3D -I $(MAKEROOT)/Include/Arm/ > else ifeq ($(HOST_ARCH), AARCH64) >=20 > ARCH_INCLUDE =3D -I $(MAKEROOT)/Include/AArch64/ >=20 >=20 >=20 > +else ifeq ($(HOST_ARCH), RISCV64) >=20 > +ARCH_INCLUDE =3D -I $(MAKEROOT)/Include/RiscV64/ >=20 > + >=20 > else >=20 > $(error Bad HOST_ARCH) >=20 > endif >=20 > -- > 2.28.0 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#65443): = https://edk2.groups.io/g/devel/message/65443 > Mute This Topic: https://groups.io/mt/77011297/4905953 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub > [gaoliming@byosoft.com.cn] > -=3D-=3D-=3D-=3D-=3D-=3D >=20