Hi Jiewen, Jian, Xiaoyu and Guomin,
This patch has not been reviewed, would you please review it?


Thanks,
Chao
--------

On 9月 14 2022, at 5:36 δΈ‹εˆ, Chao Li <lichao@loongson.cn> wrote:
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4053

Add LOONGARCH64 architecture for EDK2 CI testing.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>

Signed-off-by: Chao Li <lichao@loongson.cn>
---
CryptoPkg/CryptoPkg.dsc | 3 ++-
CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf | 6 +++++-
CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf | 4 ++++
CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf | 3 ++-
CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf | 3 ++-
CryptoPkg/Library/BaseCryptLibOnProtocolPpi/PeiCryptLib.inf | 3 ++-
CryptoPkg/Library/Include/CrtLibSupport.h | 3 ++-
CryptoPkg/Library/OpensslLib/OpensslLib.inf | 2 ++
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 ++
CryptoPkg/Library/TlsLib/TlsLib.inf | 3 ++-
CryptoPkg/Library/TlsLibNull/TlsLibNull.inf | 3 ++-
11 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc
index 50e7721f25..c3a02aafb0 100644
--- a/CryptoPkg/CryptoPkg.dsc
+++ b/CryptoPkg/CryptoPkg.dsc
@@ -4,6 +4,7 @@
#

# Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.<BR>

# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>

+# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>

# SPDX-License-Identifier: BSD-2-Clause-Patent

#

##

@@ -19,7 +20,7 @@
PLATFORM_VERSION = 0.98

DSC_SPECIFICATION = 0x00010005

OUTPUT_DIRECTORY = Build/CryptoPkg

- SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64|RISCV64

+ SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64|RISCV64|LOONGARCH64

BUILD_TARGETS = DEBUG|RELEASE|NOOPT

SKUID_IDENTIFIER = DEFAULT



diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
index 3d7b917103..f8790d2c72 100644
--- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
@@ -8,6 +8,7 @@
#

# Copyright (c) 2009 - 2022, Intel Corporation. All rights reserved.<BR>

# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>

+# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>

# SPDX-License-Identifier: BSD-2-Clause-Patent

#

##

@@ -24,7 +25,7 @@
#

# The following information is for reference only and not required by the build tools.

#

-# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 RISCV64

+# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 RISCV64 LOONGARCH64

#



[Sources]

@@ -74,6 +75,9 @@
[Sources.RISCV64]

Rand/CryptRand.c



+[Sources.LOONGARCH64]

+ Rand/CryptRand.c

+

[Packages]

MdePkg/MdePkg.dec

CryptoPkg/CryptoPkg.dec

diff --git a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
index d28fb98b66..7da789d00e 100644
--- a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
@@ -13,6 +13,7 @@
#

# Copyright (c) 2009 - 2022, Intel Corporation. All rights reserved.<BR>

# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>

+# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>

# SPDX-License-Identifier: BSD-2-Clause-Patent

#

##

@@ -79,6 +80,9 @@
[Sources.RISCV64]

Rand/CryptRand.c



+[Sources.LOONGARCH64]

+ Rand/CryptRand.c

+

[Packages]

MdePkg/MdePkg.dec

CryptoPkg/CryptoPkg.dec

diff --git a/CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf b/CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
index 63d1d82d19..1d8b502813 100644
--- a/CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
+++ b/CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
@@ -8,6 +8,7 @@
#

# Copyright (c) 2009 - 2022, Intel Corporation. All rights reserved.<BR>

# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>

+# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>

# SPDX-License-Identifier: BSD-2-Clause-Patent

#

##

@@ -24,7 +25,7 @@
#

# The following information is for reference only and not required by the build tools.

#

-# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 RISCV64

+# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 RISCV64 LOONGARCH64

#



[Sources]

diff --git a/CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf b/CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf
index baa4433cbe..b4945de336 100644
--- a/CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf
@@ -4,6 +4,7 @@
#

# Copyright (C) Microsoft Corporation. All rights reserved.

# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>

+# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>

# SPDX-License-Identifier: BSD-2-Clause-Patent

#

##

@@ -22,7 +23,7 @@
#

# The following information is for reference only and not required by the build tools.

#

-# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 RISCV64

+# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 RISCV64 LOONGARCH64

#



[Packages]

diff --git a/CryptoPkg/Library/BaseCryptLibOnProtocolPpi/PeiCryptLib.inf b/CryptoPkg/Library/BaseCryptLibOnProtocolPpi/PeiCryptLib.inf
index 038ca71890..e7d153db0b 100644
--- a/CryptoPkg/Library/BaseCryptLibOnProtocolPpi/PeiCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLibOnProtocolPpi/PeiCryptLib.inf
@@ -4,6 +4,7 @@
#

# Copyright (C) Microsoft Corporation. All rights reserved.

# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>

+# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>

# SPDX-License-Identifier: BSD-2-Clause-Patent

#

##

@@ -21,7 +22,7 @@
#

# The following information is for reference only and not required by the build tools.

#

-# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 RISCV64

+# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 RISCV64 LOONGARCH64

#



[Packages]

diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/Include/CrtLibSupport.h
index e49060124f..5072c343da 100644
--- a/CryptoPkg/Library/Include/CrtLibSupport.h
+++ b/CryptoPkg/Library/Include/CrtLibSupport.h
@@ -4,6 +4,7 @@


Copyright (c) 2010 - 2022, Intel Corporation. All rights reserved.<BR>

Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>

+Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>

SPDX-License-Identifier: BSD-2-Clause-Patent



**/

@@ -46,7 +47,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#define CONFIG_HEADER_BN_H



#if !defined (SIXTY_FOUR_BIT) && !defined (THIRTY_TWO_BIT)

- #if defined (MDE_CPU_X64) || defined (MDE_CPU_AARCH64) || defined (MDE_CPU_IA64) || defined (MDE_CPU_RISCV64)

+ #if defined (MDE_CPU_X64) || defined (MDE_CPU_AARCH64) || defined (MDE_CPU_IA64) || defined (MDE_CPU_RISCV64) || defined (MDE_CPU_LOONGARCH64)

//

// With GCC we would normally use SIXTY_FOUR_BIT_LONG, but MSVC needs

// SIXTY_FOUR_BIT, because 'long' is 32-bit and only 'long long' is

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index c899b811b1..f0ca72eeed 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -3,6 +3,7 @@
#

# Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>

# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>

+# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>

# SPDX-License-Identifier: BSD-2-Clause-Patent

#

##

@@ -675,6 +676,7 @@
GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=unused-but-set-variable

GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable

GCC:*_*_RISCV64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable

+ GCC:*_*_LOONGARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable

GCC:*_CLANG35_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized

GCC:*_CLANG38_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized

GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized -Wno-error=incompatible-pointer-types -Wno-error=pointer-sign -Wno-error=implicit-function-declaration -Wno-error=ignored-pragma-optimize

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 0ec3724541..195016fd3d 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -3,6 +3,7 @@
#

# Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>

# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>

+# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>

# SPDX-License-Identifier: BSD-2-Clause-Patent

#

##

@@ -624,6 +625,7 @@
GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=unused-but-set-variable

GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable

GCC:*_*_RISCV64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable

+ GCC:*_*_LOONGARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable

GCC:*_CLANG35_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized

GCC:*_CLANG38_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized

GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized -Wno-error=incompatible-pointer-types -Wno-error=pointer-sign -Wno-error=implicit-function-declaration -Wno-error=ignored-pragma-optimize

diff --git a/CryptoPkg/Library/TlsLib/TlsLib.inf b/CryptoPkg/Library/TlsLib/TlsLib.inf
index bc61cda745..20b0ea6832 100644
--- a/CryptoPkg/Library/TlsLib/TlsLib.inf
+++ b/CryptoPkg/Library/TlsLib/TlsLib.inf
@@ -3,6 +3,7 @@
#

# Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>

# (C) Copyright 2016-2020 Hewlett Packard Enterprise Development LP<BR>

+# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>

# SPDX-License-Identifier: BSD-2-Clause-Patent

#

##

@@ -19,7 +20,7 @@
#

# The following information is for reference only and not required by the build tools.

#

-# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 RISCV64

+# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 RISCV64 LOONGARCH64

#



[Sources]

diff --git a/CryptoPkg/Library/TlsLibNull/TlsLibNull.inf b/CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
index b2920ddacf..12d7cc764a 100644
--- a/CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
+++ b/CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
@@ -3,6 +3,7 @@
#

# Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>

# (C) Copyright 2016-2020 Hewlett Packard Enterprise Development LP<BR>

+# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>

# SPDX-License-Identifier: BSD-2-Clause-Patent

#

##

@@ -19,7 +20,7 @@
#

# The following information is for reference only and not required by the build tools.

#

-# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 RISCV64

+# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 RISCV64 LOONGARCH64

#



[Sources]

--
2.27.0