From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.groups.io with SMTP id smtpd.web12.3545.1606909479434107431 for ; Wed, 02 Dec 2020 03:44:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=QtyRp4J3; spf=pass (domain: nuviainc.com, ip: 209.85.128.42, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f42.google.com with SMTP id k10so6340421wmi.3 for ; Wed, 02 Dec 2020 03:44:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=bUSQy+dkKRuaFLV9AQbgM5Vr9MjVEZB07Fr/oiQklVw=; b=QtyRp4J3gpAi4TmT5tXD+/jNve5U6kAGVKb5a8/zHI4ZU2h7bZ6Zu3lcAAKIidbfua IaDvOjy/Galc0F2XWzDhcMW/0Us8rd9dK7MaQnyjGyLvHKyJp2oiqbNd7jR5EM2myjSL fw8PeX5huK6ewx84aphVxa7BO2cajsQqbTsXwK5HZbRyb9wexc4sB4T1Vryfubls3zuW fd6AEcieHPu1WvdDhZfnY5xJydCluRsPjyRQoy11NBKaUR4rXLqUi/IccysvUae1eEeb pBTEL94KfEG8tMNxUW3FPnRJDuCM46nW6EzXB+TwWi8OcEvyB1DPAFCNAhPuVG0wYyNx dB5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=bUSQy+dkKRuaFLV9AQbgM5Vr9MjVEZB07Fr/oiQklVw=; b=RzPfnsdj5cA9hJXUqzOlMdR4hi5pXh39RU0R9CjDq7eVgg8gY9ng+G8XChezYOFGZT fSt0cQ29q244LN8Y7QVQ867Gl5fa3z4XLVgmwdqiQRM4vhLyf0eo8bay6qVyc9L9apdn 44NFz19di5yjU2FSj7JO8pgOKTDkzCOzYQyIFjF8GBGgLLTfvq8aL9AHNS3pcZXkIAm1 dXp+P6Lq6RK4an3+Ab4v9HH7lLN/lUVWM8YlGKiDcRULAkrqV+rhCkekiDN6T1t9vYjU LpGQNh4Y7F+HxF1Jm1OOd+MJj6v4Q+QI1a5jC0cohtJ3S6+ylnm1TJZ2ybtvpWZjaE64 gLlg== X-Gm-Message-State: AOAM530jl/dx/ViwoCk/bm8v3YBenIHNMskKM3bNU5Y/ULSJ5jDVKIvN MfNJeQ73QZ0yNcpXLr8o1QPv9sNKYQjwozFMOBFBozNLZMWN52N+JnK8ECDXN/57ZK+bXtxj9E3 mv7YjshFVmnONrL+DTa3rWwiKoqh79yXjWGSk3umH5fOErQ6JqMfCj8O/El+hjk98n076 X-Google-Smtp-Source: ABdhPJy3e4IgE+aBG5GDpGvBQwRb/+F8VY4eZAbsV9wRn3eKncCZ/nDVnnr5T3KjJPmp5VF7PGVxNA== X-Received: by 2002:a1c:9901:: with SMTP id b1mr2723484wme.18.1606909477640; Wed, 02 Dec 2020 03:44:37 -0800 (PST) Return-Path: Received: from vanye (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id f14sm1643371wme.14.2020.12.02.03.44.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 03:44:37 -0800 (PST) Date: Wed, 2 Dec 2020 11:44:35 +0000 From: "Leif Lindholm" To: devel@edk2.groups.io, daniel.schaefer@hpe.com Cc: Heinrich Schuchardt , Abner Chang , Gilbert Chen , Eric Jin , G Edhaya Chandran , Barton Gao , Samer El-Haj-Mahmoud Subject: Re: [edk2-devel] [edk2-test PATCH v1 1/2] SctPkg: Add RISCV64 support Message-ID: <20201202114435.GD1664@vanye> References: <20201201161752.23734-1-daniel.schaefer@hpe.com> <20201201161752.23734-2-daniel.schaefer@hpe.com> MIME-Version: 1.0 In-Reply-To: <20201201161752.23734-2-daniel.schaefer@hpe.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Dec 02, 2020 at 00:17:51 +0800, Daniel Schaefer wrote: > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042 > > TODO: Need to check whether we can avoid copying Aarch64 sources. > > Cc: Leif Lindholm > Cc: Heinrich Schuchardt > Cc: Abner Chang > Cc: Gilbert Chen > Cc: Eric Jin > Cc: G Edhaya Chandran > Cc: Barton Gao > Cc: Samer El-Haj-Mahmoud > Signed-off-by: Daniel Schaefer > --- > uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h | 3 + > uefi-sct/SctPkg/Library/SctLib/SctLib.inf | 6 ++ > uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf | 6 ++ > uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf | 7 +++ > uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf | 6 ++ > uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf | 4 ++ > uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf | 4 ++ > uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf | 5 ++ > uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile | 3 + > uefi-sct/SctPkg/UEFI/IHV_SCT.dsc | 14 ++++- > uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h | 62 +++++++++++++++++++- > uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc | 14 ++++- > uefi-sct/SctPkg/build.sh | 10 +++- > 13 files changed, 140 insertions(+), 4 deletions(-) > > diff --git a/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h b/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h > index a7815580..3a7c8f31 100644 > --- a/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h > +++ b/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h > @@ -32,6 +32,9 @@ > #elif defined(EFIAARCH64) > #define INSTALL_SCT_PLATFORM_SHORT_NAME L"aarch64" > #define INSTALL_SCT_PLATFORM_NAME L"AARCH64" > +#elif defined(EFIRISCV64) > + #define INSTALL_SCT_PLATFORM_SHORT_NAME L"riscv64" > + #define INSTALL_SCT_PLATFORM_NAME L"RISCV64" > #else > #error "Architecture not supported" > #endif > diff --git a/uefi-sct/SctPkg/Library/SctLib/SctLib.inf b/uefi-sct/SctPkg/Library/SctLib/SctLib.inf > index 23cb77fb..6f59d974 100644 > --- a/uefi-sct/SctPkg/Library/SctLib/SctLib.inf > +++ b/uefi-sct/SctPkg/Library/SctLib/SctLib.inf > @@ -62,6 +62,12 @@ > Aarch64/initplat.c > Math.c > > +# TODO: Copied source from AARCH64, need to check if they need to be adjusted TODOs need to go, throughout. > +[sources.RISCV64] > + Riscv64/SctLibPlat.h > + Riscv64/initplat.c > + Math.c > + > [sources.ia32] > ia32/SctLibPlat.h > ia32/initplat.c > diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf b/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf > index 7aca6e30..66de4cac 100644 > --- a/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf > +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf > @@ -39,6 +39,12 @@ > Aarch64/GoVirtual.asm | RVCT > Aarch64/GoVirtual.S | GCC > > +# TODO: Copied source from AARCH64, need to check if they need to be adjusted > +# ASM is adjusted but not sure if it is correct > +[sources.RISCV64] > + Riscv64/VirtualMemory.c > + Riscv64/GoVirtual.S | GCC > + > [sources.ia32] > ia32/VirtualMemory.c > ia32/GoVirtual.asm | MSFT > diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf b/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf > index ad0eb0f8..bc0ade5b 100644 > --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf > +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf > @@ -69,6 +69,13 @@ > Aarch64/Dump.c > Aarch64/Debug.c > > +# TODO: Copied source from AARCH64, need to check if they need to be adjusted > +[sources.RISCV64] > + Riscv64/Io.c > + Riscv64/Io.h > + Riscv64/Dump.c > + Riscv64/Debug.c > + > [sources.common] > Guid.h > Guid.c > diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf > index 799f86fd..7010c7f1 100644 > --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf > +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf > @@ -67,6 +67,12 @@ > Aarch64/DebugSupportBBTestExceptionCallbackFunction.c > Aarch64/DebugSupportBBTestCacheFunction.c > > +# TODO: Copied source from AARCH64, need to check if they need to be adjusted > +[sources.RISCV64] > + Riscv64/PlatformIsa.c > + Riscv64/DebugSupportBBTestExceptionCallbackFunction.c > + Riscv64/DebugSupportBBTestCacheFunction.c > + > [Packages] > SctPkg/SctPkg.dec > SctPkg/UEFI/UEFI.dec > diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf > index e8118739..e42acd29 100644 > --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf > +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf > @@ -55,6 +55,10 @@ > #[sources.Aarch64] > # IPF/TimerInterrupt.c > > +# TODO: Seems like almost all archs can use the IPF code, need to check > +[sources.Riscv64] > + IPF/TimerInterrupt.c > + > [Packages] > MdePkg/MdePkg.dec > SctPkg/SctPkg.dec > diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf > index efc438c1..0d47536f 100644 > --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf > +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf > @@ -55,6 +55,10 @@ > [sources.Aarch64] > Aarch64/TimerInterrupt.c > > +# TODO: Copied source from AARCH64, need to check if they need to be adjusted > +[sources.RISCV64] > + Riscv64/TimerInterrupt.c > + > [Packages] > MdePkg/MdePkg.dec > SctPkg/SctPkg.dec > diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf > index 23f12d1a..1b2a92f2 100644 > --- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf > +++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf > @@ -66,6 +66,11 @@ > Aarch64/EntsLibPlat.h > Aarch64/InitPlat.c > > +# TODO: Copied source from AARCH64, need to check if they need to be adjusted > +[sources.RISCV64] > + Riscv64/EntsLibPlat.h > + Riscv64/InitPlat.c > + > [Packages] > MdePkg/MdePkg.dec > SctPkg/SctPkg.dec > diff --git a/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile b/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile > index c235f313..e49284e7 100644 > --- a/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile > +++ b/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile > @@ -31,6 +31,9 @@ ifndef ARCH > ifneq (,$(findstring arm,$(uname_m))) > ARCH=ARM > endif > + ifneq (,$(findstring riscv64,$(uname_m))) > + ARCH=RISCV64 > + endif > ifndef ARCH > $(info Could not detected ARCH from uname results) > $(error ARCH is not defined!) > diff --git a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc b/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc > index f9e86264..2f373c5f 100644 > --- a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc > +++ b/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc > @@ -42,7 +42,7 @@ > PLATFORM_VERSION = 0.1 > DSC_SPECIFICATION = 0x00010005 > OUTPUT_DIRECTORY = Build/IhvSct > - SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64 > + SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64|RISCV64 > BUILD_TARGETS = DEBUG|RELEASE > SKUID_IDENTIFIER = DEFAULT > > @@ -109,6 +109,12 @@ > *_*_AARCH64_PP_FLAGS = -D EFIAARCH64 $(GCC_VER_MACRO) > RVCT:*_*_AARCH64_DLINK_FLAGS = --muldefweak > > + *_*_RISCV64_CC_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) > + GCC:*_*_RISCV64_CC_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error These flags do not look RISCV64-specific. If there are bugs to be fixed in common code, they should be fixed. If there are too many to usefully test, then the flags should be set for GCC:*_*_*_CC_FLAGS > + *_*_RISCV64_VFRPP_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) > + *_*_RISCV64_APP_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) > + *_*_RISCV64_PP_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) > + > DEBUG_*_*_CC_FLAGS = -DEFI_DEBUG > RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG > > @@ -124,6 +130,9 @@ > [Libraries.AARCH64] > ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf > > +[Libraries.RISCV64] > + ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf > + > [Libraries.IA32,Libraries.X64] > > [LibraryClasses.common] > @@ -146,6 +155,9 @@ > [LibraryClasses.AARCH64] > NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf > > +[LibraryClasses.RISCV64] > + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf > + > [LibraryClasses.IA32] > > ############################################################################### > diff --git a/uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h b/uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h > index 7fba87ae..fb11bda4 100644 > --- a/uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h > +++ b/uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h > @@ -607,6 +607,60 @@ typedef struct { > UINT64 FAR; // Fault Address Register > } EFI_SYSTEM_CONTEXT_AARCH64; > > +/// > +/// RISC-V processor exception types. > +/// > +#define EXCEPT_RISCV_INST_MISALIGNED 0 > +#define EXCEPT_RISCV_INST_ACCESS_FAULT 1 > +#define EXCEPT_RISCV_ILLEGAL_INST 2 > +#define EXCEPT_RISCV_BREAKPOINT 3 > +#define EXCEPT_RISCV_LOAD_ADDRESS_MISALIGNED 4 > +#define EXCEPT_RISCV_LOAD_ACCESS_FAULT 5 > +#define EXCEPT_RISCV_STORE_AMO_ADDRESS_MISALIGNED 6 > +#define EXCEPT_RISCV_STORE_AMO_ACCESS_FAULT 7 > +#define EXCEPT_RISCV_ENV_CALL_FROM_UMODE 8 > +#define EXCEPT_RISCV_ENV_CALL_FROM_SMODE 9 > +#define EXCEPT_RISCV_ENV_CALL_FROM_HMODE 10 > +#define EXCEPT_RISCV_ENV_CALL_FROM_MMODE 11 > + > +#define EXCEPT_RISCV_SOFTWARE_INT 0x0 > +#define EXCEPT_RISCV_TIMER_INT 0x1 > + > +typedef struct { > + UINT64 X0; > + UINT64 X1; > + UINT64 X2; > + UINT64 X3; > + UINT64 X4; > + UINT64 X5; > + UINT64 X6; > + UINT64 X7; > + UINT64 X8; > + UINT64 X9; > + UINT64 X10; > + UINT64 X11; > + UINT64 X12; > + UINT64 X13; > + UINT64 X14; > + UINT64 X15; > + UINT64 X16; > + UINT64 X17; > + UINT64 X18; > + UINT64 X19; > + UINT64 X20; > + UINT64 X21; > + UINT64 X22; > + UINT64 X23; > + UINT64 X24; > + UINT64 X25; > + UINT64 X26; > + UINT64 X27; > + UINT64 X28; > + UINT64 X29; > + UINT64 X30; > + UINT64 X31; > +} EFI_SYSTEM_CONTEXT_RISCV64; > + > // > // Universal EFI_SYSTEM_CONTEXT definition > // > @@ -618,6 +672,7 @@ union { > EFI_SYSTEM_CONTEXT_IPF *SystemContextIpf; > EFI_SYSTEM_CONTEXT_ARM *SystemContextArm; > EFI_SYSTEM_CONTEXT_AARCH64 *SystemContextAArch64; > + EFI_SYSTEM_CONTEXT_RISCV64 *SystemContextRiscV64; > } EFI_SYSTEM_CONTEXT; > > // > @@ -645,6 +700,10 @@ VOID > #define IMAGE_FILE_MACHINE_EBC 0x0EBC > #define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED 0x01c2 > #define IMAGE_FILE_MACHINE_ARM64 0xAA64 > +#define IMAGE_FILE_MACHINE_RISCV32 0x5032 > +#define IMAGE_FILE_MACHINE_RISCV64 0x5064 > +#define IMAGE_FILE_MACHINE_RISCV128 0x5128 This set is not adding support for RISCV32/RISCV128, so no real point adding those #defines. > + > > typedef > enum { > @@ -653,7 +712,8 @@ enum { > IsaIpf = IMAGE_FILE_MACHINE_IA64, > IsaEbc = IMAGE_FILE_MACHINE_EBC, > IsaArm = IMAGE_FILE_MACHINE_ARMTHUMB_MIXED, ///< 0x01c2 > - IsaAArch64 = IMAGE_FILE_MACHINE_ARM64 ///< 0xAA64 > + IsaAArch64 = IMAGE_FILE_MACHINE_ARM64, ///< 0xAA64 > + IsaRiscv64 = IMAGE_FILE_MACHINE_RISCV64 Add the doxygen comment to match the others. > } EFI_INSTRUCTION_SET_ARCHITECTURE; > > typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL;; > diff --git a/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc b/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc > index 2e97687b..666f06dd 100644 > --- a/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc > +++ b/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc > @@ -42,7 +42,7 @@ > PLATFORM_VERSION = 0.1 > DSC_SPECIFICATION = 0x00010005 > OUTPUT_DIRECTORY = Build/UefiSct > - SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64 > + SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64|RISCV64 > BUILD_TARGETS = DEBUG|RELEASE > SKUID_IDENTIFIER = DEFAULT > > @@ -112,6 +112,12 @@ > *_*_AARCH64_PP_FLAGS = -D EFIAARCH64 $(GCC_VER_MACRO) > RVCT:*_*_AARCH64_DLINK_FLAGS = --muldefweak > > + *_*_RISCV64_CC_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) > + GCC:*_*_RISCV64_CC_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error Same as above. / Leif > + *_*_RISCV64_VFRPP_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) > + *_*_RISCV64_APP_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) > + *_*_RISCV64_PP_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) > + > DEBUG_*_*_CC_FLAGS = -DEFI_DEBUG > RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG > > @@ -129,6 +135,9 @@ > [Libraries.AARCH64] > ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf > > +[Libraries.RISCV64] > + ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf > + > [LibraryClasses.common] > UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf > UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf > @@ -157,6 +166,9 @@ > [LibraryClasses.AARCH64] > NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf > > +[LibraryClasses.RISCV64] > + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf > + > ############################################################################### > # > # These are the components that will be built by the master makefile > diff --git a/uefi-sct/SctPkg/build.sh b/uefi-sct/SctPkg/build.sh > index cad17ccd..3d61daed 100755 > --- a/uefi-sct/SctPkg/build.sh > +++ b/uefi-sct/SctPkg/build.sh > @@ -22,6 +22,8 @@ function get_build_arch > BUILD_ARCH=ARM;; > aarch64*) > BUILD_ARCH=AARCH64;; > + riscv64*) > + BUILD_ARCH=RISCV64;; > *) > BUILD_ARCH=other;; > esac > @@ -47,6 +49,12 @@ function set_cross_compile > else > TEMP_CROSS_COMPILE=arm-linux-gnueabihf- > fi > + elif [ "$SCT_TARGET_ARCH" == "RISCV64" ]; then > + if [ X"$CROSS_COMPILE_64" != X"" ]; then > + TEMP_CROSS_COMPILE="$CROSS_COMPILE_64" > + else > + TEMP_CROSS_COMPILE=riscv64-unknown-elf- > + fi > else > echo "Unsupported target architecture '$SCT_TARGET_ARCH'!" >&2 > fi > @@ -110,7 +118,7 @@ PrintUsage() { > #Print Help > # > echo "Usage:" > - echo " $0 \ > + echo " $0 \ > \ > [build type (RELEASE OR DEBUG, DEFAULT: DEBUG)]" > } > -- > 2.28.0 > > > > > >