From nobody Tue Feb 10 20:50:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+94412+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+94412+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1664277271; cv=none; d=zohomail.com; s=zohoarc; b=jDZpn44E0dxoxl+7rLTH+ODc+MyRJAewOofCkoDFADtUCjIbw45bA10PrBArF4UcXVktLCLz2rugwkcnMFfzMIr2+UFpae0s4+bIt/Ne+jivqy002ZqxUWbNylV74BggcUgNN/cQlKEUyiXljCkRaMVStXV3yrV3/rirfe2cU/Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664277271; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=t/nNs9eJy7Iqo5IiLLF3qkwLyp0Pl9eVieJRJgkKx+o=; b=iZAFiSbyScmEiZ02Pe6E6M84bWduK8fUJ88kfxhx6SIVa41DoGIP7R7f1wYOwjl6J0zSpLfoarjtHuj/tjLJGg5vYCL7WJ7Ww0OXkULcwDx3l1alx9KZmaSTufwcefg6QgQsXOSZMSZIcyTcAJkKbGPUlLhTGFec8FUZrkqU3E0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+94412+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 166427727110753.57717107081112; Tue, 27 Sep 2022 04:14:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id yOoFYY1788612xoum954IHfK; Tue, 27 Sep 2022 04:14:30 -0700 X-Received: from loongson.cn (loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web08.9462.1664277269729470793 for ; Tue, 27 Sep 2022 04:14:30 -0700 X-Received: from code-server.gen (unknown [10.2.9.245]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cxrmv02jJjirsiAA--.49762S20; Tue, 27 Sep 2022 19:14:28 +0800 (CST) From: "Chao Li" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen , Baoqi Zhang Subject: [edk2-devel] [PATCH v3 18/34] BaseTools: Add LoongArch64 binding. Date: Tue, 27 Sep 2022 19:13:38 +0800 Message-Id: <20220927111354.4107719-19-lichao@loongson.cn> In-Reply-To: <20220927111354.4107719-1-lichao@loongson.cn> References: <20220927111354.4107719-1-lichao@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cxrmv02jJjirsiAA--.49762S20 X-Coremail-Antispam: 1UD129KBjvJXoWxXFWxZr43JFWUKr1rWrWkCrg_yoW5uF47pa nI9F4fG3y0grW3CryfKFW5Wr4fGr40kayxtrWSv343ArWDKw1xW34agF4UGFWUJwsYg34r XF1Yg3W7tasrA3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_UUUUUUUUU== X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQACCGMxll4dbgAbs5 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lichao@loongson.cn X-Gm-Message-State: vZQAXUIpEsadKUArk5X4RvTQx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1664277270; bh=0S0ept1B7eVUlmODZRCiZ30BU12AvrfuBo+yWA8lu3Y=; h=Cc:Date:From:Reply-To:Subject:To; b=rd9GhDwyqYLM1SV7XpKH+zFfWjx5oOZGh/V3ViOFPTQHoKpjZCaL388siFaezWGaP3z X4+47SnTAQ3jQidzqcUwjOkdZW5FXYHh+lHwWN6g7ksOrP28VsEwJWKRITEVT4Ubo3Qde /CFovx6Eghamxaz+x6YwMrQsE3kYK7WlrCo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1664277273195100044 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Liming Gao --- 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/BaseT= ools/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 rights = 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 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 i= nstructions, +// 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 --=20 2.27.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#94412): https://edk2.groups.io/g/devel/message/94412 Mute This Topic: https://groups.io/mt/93947370/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-