From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from walk.intel-email.com (walk.intel-email.com [101.227.64.242]) by mx.groups.io with SMTP id smtpd.web08.7082.1663223649603861126 for ; Wed, 14 Sep 2022 23:34:09 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@byosoft.com.cn header.s=cloud-union header.b=HU/idIbw; spf=pass (domain: byosoft.com.cn, ip: 101.227.64.242, mailfrom: gaoliming@byosoft.com.cn) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id AF874CD1F65D for ; Thu, 15 Sep 2022 14:34:06 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=byosoft.com.cn; s=cloud-union; t=1663223646; bh=8iywNgLcTlFk1aoM/40jNsd7U8HeLzQvp1OCtb8kZdo=; h=From:To:Cc:References:In-Reply-To:Subject:Date; b=HU/idIbwvjrPD5StL4r/6h+x+aIHzIpFRO/LNzBpTaxyM3QTZt/C8HA1LJRdI1os8 94y0zUVqL5thhBnMjSG+INI1bJ5VCa52Z1HxXvPsxP/7xPwy7Y4Em3XnnBs6ewq6nB piuHcymhk8EvITdGCNKmR+PVE+7iJBhOg3Ulpg58= Received: from localhost (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id ABCA0CD1F747 for ; Thu, 15 Sep 2022 14:34:06 +0800 (CST) X-Virus-Scanned: by SpamTitan at intel-email.com Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 720DBCD1F64C for ; Thu, 15 Sep 2022 14:34:06 +0800 (CST) Authentication-Results: walk.intel-email.com; none Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by walk.intel-email.com (Postfix) with SMTP id 00EE8CD1F631 for ; Thu, 15 Sep 2022 14:34:03 +0800 (CST) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Thu, 15 Sep 2022 14:34:01 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , Cc: "'Bob Feng'" , "'Yuwei Chen'" , "'Baoqi Zhang'" References: <20220914094231.3700667-1-lichao@loongson.cn> In-Reply-To: <20220914094231.3700667-1-lichao@loongson.cn> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIHYyIDM0LzM0XSBCYXNlVG9vbHM6IEFkZCBMb29uZ0FyY2g2NCBiaW5kaW5nLg==?= Date: Thu, 15 Sep 2022 14:34:02 +0800 Message-ID: <003e01d8c8cd$25917450$70b45cf0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIGwRKYu0j3uwrvZ7ZCZ9o1rKjnra2EF6Iw Sender: "gaoliming" Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Chao: This change should be placed together with other changes in BaseTools. = I mean their commits can be placed together. =20 The code change is good to me. Reviewed-by: Liming Gao = Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io = =B4=FA=B1=ED Chao Li > =B7=A2=CB=CD=CA=B1=BC=E4: 2022=C4=EA9=D4=C214=C8=D5 17:43 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Bob Feng ; Liming Gao > ; Yuwei Chen ; Baoqi > Zhang > =D6=F7=CC=E2: [edk2-devel] [PATCH v2 34/34] BaseTools: Add LoongArch64 = binding. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4053 >=20 > Add LoongArch64 ProcessorBin.h and add LoongArch to Makefiles. >=20 > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen >=20 > Signed-off-by: Chao Li > Co-authored-by: Baoqi Zhang > --- > BaseTools/Source/C/GNUmakefile | 3 + > .../C/Include/LoongArch64/ProcessorBind.h | 80 > +++++++++++++++++++ > 2 files changed, 83 insertions(+) > create mode 100644 > BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h >=20 > diff --git a/BaseTools/Source/C/GNUmakefile > b/BaseTools/Source/C/GNUmakefile > index 8c191e0c38..5275f657ef 100644 > --- a/BaseTools/Source/C/GNUmakefile > +++ b/BaseTools/Source/C/GNUmakefile > @@ -29,6 +29,9 @@ ifndef HOST_ARCH > ifneq (,$(findstring riscv64,$(uname_m))) >=20 > HOST_ARCH=3DRISCV64 >=20 > endif >=20 > + ifneq (,$(findstring loongarch64,$(uname_m))) >=20 > + HOST_ARCH=3DLOONGARCH64 >=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/LoongArch64/ProcessorBind.h > b/BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h > new file mode 100644 > index 0000000000..0267859dee > --- /dev/null > +++ b/BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h > @@ -0,0 +1,80 @@ > +/** @file >=20 > + Processor or Compiler specific defines and types for LoongArch >=20 > + >=20 > + Copyright (c) 2022, Loongson Technology Corporation Limited. All = rights > reserved.
>=20 > + >=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=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_LOONGARCH64 >=20 > + >=20 > +#define EFIAPI >=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 0x8000000000000000ULL >=20 > +// >=20 > +// A value of native width with the two highest bits set. >=20 > +// >=20 > +#define MAX_2_BITS 0xC000000000000000ULL >=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 > +// >=20 > +// The stack alignment required for LoongArch >=20 > +// >=20 > +#define CPU_STACK_ALIGNMENT 16 >=20 > + >=20 > +#endif >=20 > -- > 2.27.0 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#93776): = https://edk2.groups.io/g/devel/message/93776 > Mute This Topic: https://groups.io/mt/93674251/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