From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from loongson.cn (loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web09.7527.1663227939369627264 for ; Thu, 15 Sep 2022 00:45:41 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: loongson.cn, ip: 114.242.206.163, mailfrom: lichao@loongson.cn) Received: from lichao-PC (unknown [10.40.24.149]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx9OEX2CJjR+kZAA--.33704S2; Thu, 15 Sep 2022 15:45:27 +0800 (CST) Date: Thu, 15 Sep 2022 15:45:27 +0800 From: "Chao Li" To: =?utf-8?Q?=22gaoliming=22?= Cc: "=?utf-8?Q?devel=40edk2.groups.io?=" , =?utf-8?Q?=22'Bob_Feng'=22?= , =?utf-8?Q?=22'Yuwei_Chen'=22?= , =?utf-8?Q?=22'Baoqi_Zhang'=22?= Message-ID: In-Reply-To: <003e01d8c8cd$25917450$70b45cf0$@byosoft.com.cn> References: <003e01d8c8cd$25917450$70b45cf0$@byosoft.com.cn> Subject: =?UTF-8?B?UmU6IOWbnuWkjTogZWRrMi1kZXZlbF0gW1BBVENIIHYyIDM0LzM0XSBCYXNlVG9vbHM6IEFkZCBMb29uZ0FyY2g2NCBiaW5kaW5nLg==?= X-Mailer: Mailspring MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx9OEX2CJjR+kZAA--.33704S2 X-Coremail-Antispam: 1UD129KBjvJXoW3JFyrtw4DtF18Cw1xAw4fZrb_yoW7XFy8p3 WayayrGr40qw17C34xK3W5ur4Igr4IkF10gFZYv34IyrnFkan7Kw13Gr4UGrWUWrn0v34r ZF1Yg343tasrC3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBlb7Iv0xC_Zr1lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_Cr1j6rxdM28EF7xvwV C2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40Eb7x2 x7xS6r1j6r4UMc02F40EFcxC0VAKzVAqx4xG6I80ewAqx4xG64kEw2xG04xIwI0_Xr0_Wr 1lYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkE bVWUJVW8JwACjcxG0xvY0x0EwIxGrwCjr7xvwVCIw2I0I7xG6c02F41lc2xSY4AK6svPMx AIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_JrI_ JrWlx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwI xGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8 JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcV C2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU0Y9aDUUUUU== X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQAKCGMhxFwRQQAGsP Content-Type: multipart/alternative; boundary="6322d817_2685c4db_10c77" --6322d817_2685c4db_10c77 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Liming, Ok, in V3, I will put this patch together with BaseTools changes. Thanks, Chao -------- On 9=E6=9C=88 15 2022, at 2:34 =E4=B8=8B=E5=8D=88, "gaoliming" wrote: > Chao: > This change should be placed together with other changes in BaseTools. I > mean their commits can be placed together. > > The code change is good to me. Reviewed-by: Liming Gao com.cn> > > Thanks > Liming > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io =E4=BB=A3=E8=A1=A8 Chao Li > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B49=E6=9C=8814=E6=97= =A5 17:43 > > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > > =E6=8A=84=E9=80=81: Bob Feng ; Liming Gao > > ; Yuwei Chen ; Baoqi > > Zhang > > =E4=B8=BB=E9=A2=98: [edk2-devel] [PATCH v2 34/34] BaseTools: Add LoongA= rch64 binding. > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4053 > > > > Add LoongArch64 ProcessorBin.h and add LoongArch to Makefiles. > > > > Cc: Bob Feng > > Cc: Liming Gao > > Cc: Yuwei Chen > > > > 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 > > > > 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))) > > > > HOST_ARCH=3DRISCV64 > > > > endif > > > > + ifneq (,$(findstring loongarch64,$(uname_m))) > > > > + HOST_ARCH=3DLOONGARCH64 > > > > + 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/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 > > > > + Processor or Compiler specific defines and types for LoongArch > > > > + > > > > + Copyright (c) 2022, Loongson Technology Corporation Limited. All righ= ts > > reserved.
> > > > + > > > > + 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_LOONGARCH64 > > > > + > > > > +#define EFIAPI > > > > + > > > > +// > > > > +// Make sure we are using the correct packing rules per EFI specificat= ion > > > > +// > > > > +#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 processo= r > > 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 0x8000000000000000ULL > > > > +// > > > > +// A value of native width with the two highest bits set. > > > > +// > > > > +#define MAX_2_BITS 0xC000000000000000ULL > > > > + > > > > +#if defined (__GNUC__) > > > > +// > > > > +// For GNU assembly code, .global or .globl can declare global symbols= . > > > > +// Define this macro to unify the usage. > > > > +// > > > > +#define ASM_GLOBAL .globl > > > > +#endif > > > > + > > > > +// > > > > +// The stack alignment required for LoongArch > > > > +// > > > > +#define CPU_STACK_ALIGNMENT 16 > > > > + > > > > +#endif > > > > -- > > 2.27.0 > > > > > > > > -=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/9377= 6 > > 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 > --6322d817_2685c4db_10c77 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Liming,
Ok, in V3, I will put this patch together with BaseT= ools changes.


Thanks,
Chao
--------

<= /signature>
On 9=E6=9C=88 15 20= 22, at 2:34 =E4=B8=8B=E5=8D=88, "gaoliming" <gaoliming@byosoft.com.cn>= ; wrote:
Chao:
This change should be p= laced together with other changes in BaseTools. I
mean their comm= its can be placed together.

The code change is good to me. Re= viewed-by: Liming Gao <gaoliming@byosoft.
com.cn>

=
Thanks
Liming
> -----=E9=82=AE=E4=BB=B6=E5=8E= =9F=E4=BB=B6-----
> =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.gr= oups.io <devel@edk2.groups.io> =E4=BB=A3=E8=A1=A8 Chao Li
&= gt; =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B49=E6=9C=8814=E6=97= =A5 17:43
> =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io<= /div>
> =E6=8A=84=E9=80=81: Bob Feng <bob.c.feng@intel.com>; L= iming Gao
> <gaoliming@byosoft.com.cn>; Yuwei Chen <y= uwei.chen@intel.com>; Baoqi
> Zhang <zhangbaoqi@loongson= .cn>
> =E4=B8=BB=E9=A2=98: [edk2-devel] [PATCH v2 34/34] Ba= seTools: Add LoongArch64 binding.
>
> REF: https:= //bugzilla.tianocore.org/show_bug.cgi?id=3D4053
>
&g= t; Add LoongArch64 ProcessorBin.h and add LoongArch to Makefiles.
>
> Cc: Bob Feng <bob.c.feng@intel.com>
&g= t; Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei= Chen <yuwei.chen@intel.com>
>
> Signed-off= -by: Chao Li <lichao@loongson.cn>
> Co-authored-by: Baoq= i Zhang <zhangbaoqi@loongson.cn>
> ---
> Ba= seTools/Source/C/GNUmakefile | 3 +
> .../C/Include/LoongArch64= /ProcessorBind.h | 80
> +++++++++++++++++++
> 2 f= iles changed, 83 insertions(+)
> create mode 100644
= > BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h
><= /div>
> 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 @@ ifnde= f HOST_ARCH
> ifneq (,$(findstring riscv64,$(uname_m)))
<= div>>
> HOST_ARCH=3DRISCV64
>
> e= ndif
>
> + ifneq (,$(findstring loongarch64,$(una= me_m)))
>
> + HOST_ARCH=3DLOONGARCH64
&= gt;
> + endif
>
> ifndef HOST_ARCH
>
> $(info Could not detected HOST_ARCH from uname= results)
>
> $(error HOST_ARCH is not defined!)<= /div>
>
> diff --git a/BaseTools/Source/C/Include/Loong= Arch64/ProcessorBind.h
> b/BaseTools/Source/C/Include/LoongArc= h64/ProcessorBind.h
> new file mode 100644
> inde= x 0000000000..0267859dee
> --- /dev/null
> +++ b/= BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h
> @@ -0= ,0 +1,80 @@
> +/** @file
>
> + Proce= ssor or Compiler specific defines and types for LoongArch
>
> +
>
> + Copyright (c) 2022, Loongson= Technology Corporation Limited. All rights
> reserved.<BR&= gt;
>
> +
>
> + SPDX-Li= cense-Identifier: BSD-2-Clause-Patent
>
> +
=
>
> +**/
>
> +#ifndef PROCES= SOR_BIND_H_
>
> +#define PROCESSOR_BIND_H_
<= div>>
> +
>
> +//
><= /div>
> +// Define the processor type so other code can make process= or based
> choices
>
> +//
>
> +#define MDE_CPU_LOONGARCH64
>
= > +
>
> +#define EFIAPI
>
> +
>
> +//
>
> += // Make sure we are using the correct packing rules per EFI specification
>
> +//
>
> +#ifndef __G= NUC__
>
> +#pragma pack()
>
> +#endif
>
> +
>
>= ; +//
>
> +// Use ANSI C 2000 stdint.h integer wi= dth declarations
>
> +//
>
> +#include <stdint.h>
>
> +typedef uin= t8_t BOOLEAN;
>
> +typedef int8_t INT8;
>
> +typedef uint8_t UINT8;
>
> = +typedef int16_t INT16;
>
> +typedef uint16_t UIN= T16;
>
> +typedef int32_t INT32;
>
> +typedef uint32_t UINT32;
>
> +type= def int64_t INT64;
>
> +typedef uint64_t UINT64;<= /div>
>
> +typedef char CHAR8;
>
> +typedef uint16_t CHAR16;
>
> +
&= gt;
> +//
>
> +// Unsigned value of = native width. (4 bytes on supported 32-bit
processor
&g= t; instructions,
>
> +// 8 bytes on supported 64-= bit processor instructions)
>
> +//
>= ;
> +typedef UINT64 UINTN;
>
> +
>
> +//
>
> +// Signed val= ue of native width. (4 bytes on supported 32-bit processor
> i= nstructions,
>
> +// 8 bytes on supported 64-bit = processor instructions)
>
> +//
>
> +typedef INT64 INTN;
>
> +
>
> +//
>
> +// Processor specif= ic defines
>
> +//
>
> = +
>
> +//
>
> +// A val= ue of native width with the highest bit set.
>
> = +//
>
> +#define MAX_BIT 0x8000000000000000ULL
>
> +//
>
> +// A value o= f native width with the two highest bits set.
>
>= +//
>
> +#define MAX_2_BITS 0xC000000000000000UL= L
>
> +
>
> +#if define= d (__GNUC__)
>
> +//
>
>= ; +// For GNU assembly code, .global or .globl can declare global symbols.<= /div>
>
> +// Define this macro to unify the usage.
>
> +//
>
> +#define ASM_G= LOBAL .globl
>
> +#endif
>
> +
>
> +//
>
> +//= The stack alignment required for LoongArch
>
> += //
>
> +#define CPU_STACK_ALIGNMENT 16
= >
> +
>
> +#endif
><= /div>
> --
> 2.27.0
>
>
=
>
> -=3D-=3D-=3D-=3D-=3D-=3D
> Groups.io = Links: You receive all messages sent to this group.
> View/Rep= ly 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
>




--6322d817_2685c4db_10c77--