From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web08.5614.1646119128264075815 for ; Mon, 28 Feb 2022 23:18:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fvP2O5Jf; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646119127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Dll6QaNbx8KbCEH9A0Pv+iIseTyuj0IAGn/QvpSA2Fc=; b=fvP2O5Jf6eDgW/kZNJvJCj2fVxH8N8K13t31UQ5vL3tZpIQlXLiamdetlna5rYT9BSdRgB V7+7DSxHSlmbCwJnZVGDSeppEnIBPodHf/jUuEe5G7Nsrosulc5I0eHm4xw7Eir328ZtKG /m7uuue9NXLzvQ4Mg2ifF8TWVwPIOqw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-645-b7grv6bbN0KpGv5fmYhCQA-1; Tue, 01 Mar 2022 02:18:42 -0500 X-MC-Unique: b7grv6bbN0KpGv5fmYhCQA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 474141854E27; Tue, 1 Mar 2022 07:18:37 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.195.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F2AD21F406; Tue, 1 Mar 2022 07:18:27 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1D7541800864; Tue, 1 Mar 2022 08:18:20 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Xiaoyu Lu , Bob Feng , Rebecca Cran , James Bottomley , Sami Mujawar , Jordan Justen , Erdem Aktas , Jiewen Yao , Supreeth Venkatesh , Sebastien Boeuf , Zhichao Gao , Zhiguang Liu , Maciej Rabeda , Maurice Ma , Andrew Fish , Ard Biesheuvel , Tom Lendacky , Peter Grehan , Sean Brogan , Guomin Jiang , Bret Barkelew , Yuwei Chen , Benjamin You , Daniel Schaefer , Liming Gao , Michael D Kinney , Wei6 Xu , Jian J Wang , Jiaxin Wu , Siyuan Fu , Gerd Hoffmann , Sami Mujawar , Guo Dong , kilian_kegel@hotmail.com, Abner Chang , Oliver Steffen , Leif Lindholm , Brijesh Singh , Min Xu , Ray Ni , Alexei Fedorov , Julien Grall , Nickle Wang , Pawel Polawski , Anthony Perard Subject: [PATCH 3/3] MdePkg/CompilerIntrinsicsLib: move ia32 intrinsics and strcmp Date: Tue, 1 Mar 2022 08:18:20 +0100 Message-Id: <20220301071820.3135133-4-kraxel@redhat.com> In-Reply-To: <20220301071820.3135133-1-kraxel@redhat.com> References: <20220301071820.3135133-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Move intrinsics for ia32 from CryptoPkg/Library/IntrinsicLib to MdePkg/Library/CompilerIntrinsicsLib. Also move strcmp. Remove CryptoPkg/Library/IntrinsicLib. Use MdePkg/Library/CompilerIntrinsicsLib instead. Update all references. Signed-off-by: Gerd Hoffmann --- ArmVirtPkg/ArmVirt.dsc.inc | 2 +- CryptoPkg/CryptoPkg.dsc | 3 +- EmulatorPkg/EmulatorPkg.dsc | 2 +- FmpDevicePkg/FmpDevicePkg.dsc | 2 +- NetworkPkg/NetworkPkg.dsc | 2 +- OvmfPkg/AmdSev/AmdSevX64.dsc | 2 +- OvmfPkg/Bhyve/BhyveX64.dsc | 2 +- OvmfPkg/CloudHv/CloudHvX64.dsc | 2 +- OvmfPkg/Microvm/MicrovmX64.dsc | 2 +- OvmfPkg/OvmfPkgIa32.dsc | 2 +- OvmfPkg/OvmfPkgIa32X64.dsc | 2 +- OvmfPkg/OvmfPkgX64.dsc | 2 +- OvmfPkg/OvmfXen.dsc | 2 +- SecurityPkg/SecurityPkg.dsc | 10 +-- SignedCapsulePkg/SignedCapsulePkg.dsc | 12 +-- UefiPayloadPkg/UefiPayloadPkg.dsc | 2 +- .../Library/IntrinsicLib/IntrinsicLib.inf | 67 ----------------- .../CompilerIntrinsicsLib.inf | 14 ++++ CryptoPkg/Library/IntrinsicLib/CopyMem.c | 47 ------------ .../Library/IntrinsicLib/MemoryIntrinsics.c | 74 ------------------- .../CompilerIntrinsicsLib}/Ia32/MathFtol.c | 0 .../Ia32/MathLShiftS64.c | 0 .../Ia32/MathRShiftU64.c | 0 MdePkg/Library/CompilerIntrinsicsLib/strcmp.c | 33 +++++++++ .../Library/IntrinsicLib/BaseIntrinsicLib.uni | 16 ---- .../Ia32/MathLShiftS64.nasm | 0 .../Ia32/MathRShiftU64.nasm | 0 27 files changed, 72 insertions(+), 230 deletions(-) delete mode 100644 CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf delete mode 100644 CryptoPkg/Library/IntrinsicLib/CopyMem.c delete mode 100644 CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathFtol.c (100%) rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathLShiftS64.c (100%) rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathRShiftU64.c (100%) create mode 100644 MdePkg/Library/CompilerIntrinsicsLib/strcmp.c delete mode 100644 CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathLShiftS64.nasm (100%) rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathRShiftU64.nasm (100%) diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index 97edf0487964..d8b3db4f75ce 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -154,7 +154,7 @@ [LibraryClasses.common] # # CryptoPkg libraries needed by multiple firmware features # - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf !if $(NETWORK_TLS_ENABLE) == TRUE OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf !else diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc index 2d4d4c2797e5..d593ae0e709c 100644 --- a/CryptoPkg/CryptoPkg.dsc +++ b/CryptoPkg/CryptoPkg.dsc @@ -103,7 +103,7 @@ [LibraryClasses] UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf #??? IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf #??? OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf [LibraryClasses.ARM] @@ -240,7 +240,6 @@ [Components] CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf - CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf CryptoPkg/Library/TlsLib/TlsLib.inf CryptoPkg/Library/TlsLibNull/TlsLibNull.inf CryptoPkg/Library/OpensslLib/OpensslLib.inf diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc index 554c13ddb500..f3a97b2e4577 100644 --- a/EmulatorPkg/EmulatorPkg.dsc +++ b/EmulatorPkg/EmulatorPkg.dsc @@ -128,7 +128,7 @@ [LibraryClasses] !if $(SECURE_BOOT_ENABLE) == TRUE RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf PlatformSecureLib|SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf diff --git a/FmpDevicePkg/FmpDevicePkg.dsc b/FmpDevicePkg/FmpDevicePkg.dsc index 258b5ce0cded..f314548d4066 100644 --- a/FmpDevicePkg/FmpDevicePkg.dsc +++ b/FmpDevicePkg/FmpDevicePkg.dsc @@ -57,7 +57,7 @@ [LibraryClasses] !ifdef CONTINUOUS_INTEGRATION BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf !else - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf RngLib|MdePkg/Library/BaseRngLibNull/BaseRngLibNull.inf diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc index f69eb3d1d5c2..95dedad392fb 100644 --- a/NetworkPkg/NetworkPkg.dsc +++ b/NetworkPkg/NetworkPkg.dsc @@ -53,7 +53,7 @@ [LibraryClasses] !else BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf !endif DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc index fd56176796d5..9f735df95546 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.dsc +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc @@ -186,7 +186,7 @@ [LibraryClasses] LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc index 5fa08bebd73c..7dd438d17faa 100644 --- a/OvmfPkg/Bhyve/BhyveX64.dsc +++ b/OvmfPkg/Bhyve/BhyveX64.dsc @@ -186,7 +186,7 @@ [LibraryClasses] IoApicLib|PcAtChipsetPkg/Library/BaseIoApicLib/BaseIoApicLib.inf DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf !if $(NETWORK_TLS_ENABLE) == TRUE OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf !else diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc index 3172100310b1..2a1dced582b8 100644 --- a/OvmfPkg/CloudHv/CloudHvX64.dsc +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc @@ -196,7 +196,7 @@ [LibraryClasses] LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf !if $(NETWORK_TLS_ENABLE) == TRUE OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf !else diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc index 1ea43443ae97..1503f506321c 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -193,7 +193,7 @@ [LibraryClasses] LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf !if $(NETWORK_TLS_ENABLE) == TRUE OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf !else diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 85abed24c1a7..bab9b507fb11 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -193,7 +193,7 @@ [LibraryClasses] LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf !if $(NETWORK_TLS_ENABLE) == TRUE OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf !else diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index a9c1daecc1a8..d51254463af5 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -197,7 +197,7 @@ [LibraryClasses] LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf !if $(NETWORK_TLS_ENABLE) == TRUE OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf !else diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 718399299f57..f12221657adc 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -197,7 +197,7 @@ [LibraryClasses] LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf !if $(NETWORK_TLS_ENABLE) == TRUE OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf !else diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index efa97f09f32b..351552fabbb0 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -182,7 +182,7 @@ [LibraryClasses] LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf !if $(NETWORK_TLS_ENABLE) == TRUE OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf !else diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc index 2b5ef67016b8..b71b78f56ca5 100644 --- a/SecurityPkg/SecurityPkg.dsc +++ b/SecurityPkg/SecurityPkg.dsc @@ -101,7 +101,7 @@ [LibraryClasses.common.PEIM] !ifdef CONTINUOUS_INTEGRATION BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf !else - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf !endif @@ -119,7 +119,7 @@ [LibraryClasses.common.DXE_DRIVER] !ifdef CONTINUOUS_INTEGRATION BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf !else - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf !endif @@ -140,7 +140,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] !ifdef CONTINUOUS_INTEGRATION BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf !else - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf !endif @@ -152,7 +152,7 @@ [LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION] !ifdef CONTINUOUS_INTEGRATION BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf !else - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf !endif @@ -171,7 +171,7 @@ [LibraryClasses.common.DXE_SMM_DRIVER] !ifdef CONTINUOUS_INTEGRATION BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf !else - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf !endif diff --git a/SignedCapsulePkg/SignedCapsulePkg.dsc b/SignedCapsulePkg/SignedCapsulePkg.dsc index 72b533cd04e8..213e165be5d0 100644 --- a/SignedCapsulePkg/SignedCapsulePkg.dsc +++ b/SignedCapsulePkg/SignedCapsulePkg.dsc @@ -126,7 +126,7 @@ [LibraryClasses.common.PEIM] !ifdef CONTINUOUS_INTEGRATION BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf !else - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf !endif @@ -141,7 +141,7 @@ [LibraryClasses.common.DXE_DRIVER] !ifdef CONTINUOUS_INTEGRATION BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf !else - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf !endif @@ -155,7 +155,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] !ifdef CONTINUOUS_INTEGRATION BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf !else - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf !endif @@ -178,7 +178,7 @@ [LibraryClasses.common.DXE_SMM_DRIVER] !ifdef CONTINUOUS_INTEGRATION BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf !else - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf !endif @@ -190,7 +190,7 @@ [LibraryClasses.common.UEFI_DRIVER] !ifdef CONTINUOUS_INTEGRATION BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf !else - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf !endif @@ -202,7 +202,7 @@ [LibraryClasses.common.UEFI_APPLICATION] !ifdef CONTINUOUS_INTEGRATION BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf !else - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf !endif diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc index 1ce96a51c102..44e7abb8d129 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -179,7 +179,7 @@ [LibraryClasses] DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLib/DxeHobListLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IntrinsicLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf HobLib|UefiPayloadPkg/Library/DxeHobLib/DxeHobLib.inf diff --git a/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf b/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf deleted file mode 100644 index fcbb93316cf7..000000000000 --- a/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf +++ /dev/null @@ -1,67 +0,0 @@ -## @file -# Intrinsic Routines Wrapper Library Instance. -# -# Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = BaseIntrinsicLib - MODULE_UNI_FILE = BaseIntrinsicLib.uni - FILE_GUID = 63850097-3E97-4c4f-A52D-C811A0106105 - MODULE_TYPE = BASE - VERSION_STRING = 1.0 - LIBRARY_CLASS = IntrinsicLib - -# -# The following information is for reference only and not required by the build tools. -# -# VALID_ARCHITECTURES = IA32 X64 -# - -[Sources] - MemoryIntrinsics.c - -[Sources.IA32] - CopyMem.c - - Ia32/MathLShiftS64.c | MSFT - Ia32/MathRShiftU64.c | MSFT - Ia32/MathFtol.c | MSFT - - Ia32/MathLShiftS64.c | INTEL - Ia32/MathRShiftU64.c | INTEL - Ia32/MathFtol.c | INTEL - - Ia32/MathLShiftS64.nasm | GCC - Ia32/MathRShiftU64.nasm | GCC - -[Sources.X64] - CopyMem.c - -[Packages] - MdePkg/MdePkg.dec - -[LibraryClasses] - BaseLib - BaseMemoryLib - -[BuildOptions] - # - # Override MSFT build option to remove /Oi and /GL - # - MSFT:DEBUG_VS2003_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX- /Zi /Gm - MSFT:RELEASE_VS2003_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX- - MSFT:DEBUG_VS2003xASL_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX- /Zi /Gm - MSFT:RELEASE_VS2003xASL_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX- - MSFT:DEBUG_DDK3790_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm - MSFT:RELEASE_DDK3790_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF - MSFT:DEBUG_DDK3790xASL_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm - MSFT:RELEASE_DDK3790xASL_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF - MSFT:DEBUG_*_IA32_CC_FLAGS == /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm - MSFT:RELEASE_*_IA32_CC_FLAGS == /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF - MSFT:DEBUG_*_X64_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm - MSFT:RELEASE_*_X64_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF - INTEL:*_*_*_CC_FLAGS = /Oi- diff --git a/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf b/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf index 6fa09e5f0dec..1604f1ee802f 100644 --- a/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf +++ b/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf @@ -29,6 +29,8 @@ [Sources] memcmp_ms.c | MSFT memmove_ms.c | MSFT + strcmp.c + [Sources.ARM] Arm/mullu.asm | RVCT Arm/switch.asm | RVCT @@ -82,6 +84,18 @@ [Sources.ARM] [Sources.AARCH64] AArch64/Atomics.S | GCC +[Sources.IA32] + Ia32/MathLShiftS64.c | MSFT + Ia32/MathRShiftU64.c | MSFT + Ia32/MathFtol.c | MSFT + + Ia32/MathLShiftS64.c | INTEL + Ia32/MathRShiftU64.c | INTEL + Ia32/MathFtol.c | INTEL + + Ia32/MathLShiftS64.nasm | GCC + Ia32/MathRShiftU64.nasm | GCC + [Packages] MdePkg/MdePkg.dec diff --git a/CryptoPkg/Library/IntrinsicLib/CopyMem.c b/CryptoPkg/Library/IntrinsicLib/CopyMem.c deleted file mode 100644 index 14a213d1dadf..000000000000 --- a/CryptoPkg/Library/IntrinsicLib/CopyMem.c +++ /dev/null @@ -1,47 +0,0 @@ -/** @file - Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based - Cryptographic Library. - -Copyright (c) 2010, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include -#include - -#if defined (__clang__) && !defined (__APPLE__) - -/* Copies bytes between buffers */ -static __attribute__ ((__used__)) -void * -__memcpy ( - void *dest, - const void *src, - unsigned int count - ) -{ - return CopyMem (dest, src, (UINTN)count); -} - -__attribute__ ((__alias__ ("__memcpy"))) -void * -memcpy ( - void *dest, - const void *src, - unsigned int count - ); - -#else -/* Copies bytes between buffers */ -void * -memcpy ( - void *dest, - const void *src, - unsigned int count - ) -{ - return CopyMem (dest, src, (UINTN)count); -} - -#endif diff --git a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c b/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c deleted file mode 100644 index 611e9fd773b0..000000000000 --- a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c +++ /dev/null @@ -1,74 +0,0 @@ -/** @file - Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based - Cryptographic Library. - -Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include -#include -#include - -typedef UINTN size_t; - -#if defined (__GNUC__) || defined (__clang__) -#define GLOBAL_USED __attribute__((used)) -#else -#define GLOBAL_USED -#endif - -/* OpenSSL will use floating point support, and C compiler produces the _fltused - symbol by default. Simply define this symbol here to satisfy the linker. */ -int GLOBAL_USED _fltused = 1; - -/* Sets buffers to a specified character */ -void * -memset ( - void *dest, - int ch, - size_t count - ) -{ - // - // NOTE: Here we use one base implementation for memset, instead of the direct - // optimized SetMem() wrapper. Because the IntrinsicLib has to be built - // without whole program optimization option, and there will be some - // potential register usage errors when calling other optimized codes. - // - - // - // Declare the local variables that actually move the data elements as - // volatile to prevent the optimizer from replacing this function with - // the intrinsic memset() - // - volatile UINT8 *Pointer; - - Pointer = (UINT8 *)dest; - while (count-- != 0) { - *(Pointer++) = (UINT8)ch; - } - - return dest; -} - -/* Compare bytes in two buffers. */ -int -memcmp ( - const void *buf1, - const void *buf2, - size_t count - ) -{ - return (int)CompareMem (buf1, buf2, count); -} - -int -strcmp ( - const char *s1, - const char *s2 - ) -{ - return (int)AsciiStrCmp (s1, s2); -} diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathFtol.c similarity index 100% rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathFtol.c diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLShiftS64.c similarity index 100% rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.c rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLShiftS64.c diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.c b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathRShiftU64.c similarity index 100% rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.c rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathRShiftU64.c diff --git a/MdePkg/Library/CompilerIntrinsicsLib/strcmp.c b/MdePkg/Library/CompilerIntrinsicsLib/strcmp.c new file mode 100644 index 000000000000..937b19a3dff7 --- /dev/null +++ b/MdePkg/Library/CompilerIntrinsicsLib/strcmp.c @@ -0,0 +1,33 @@ +/** @file + Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based + Cryptographic Library. + +Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include + +typedef UINTN size_t; + +#if defined (__GNUC__) || defined (__clang__) +#define GLOBAL_USED __attribute__((used)) +#else +#define GLOBAL_USED +#endif + +/* OpenSSL will use floating point support, and C compiler produces the _fltused + symbol by default. Simply define this symbol here to satisfy the linker. */ +int GLOBAL_USED _fltused = 1; + +int +strcmp ( + const char *s1, + const char *s2 + ) +{ + return (int)AsciiStrCmp (s1, s2); +} diff --git a/CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni b/CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni deleted file mode 100644 index 47f19d4080f7..000000000000 --- a/CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni +++ /dev/null @@ -1,16 +0,0 @@ -// /** @file -// Intrinsic Routines Wrapper Library Instance. -// -// This module is intrinsic routines wrapper library instance. -// -// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-// -// SPDX-License-Identifier: BSD-2-Clause-Patent -// -// **/ - - -#string STR_MODULE_ABSTRACT #language en-US "Intrinsic Routines Wrapper Library Instance" - -#string STR_MODULE_DESCRIPTION #language en-US "This module is intrinsic routines wrapper library instance." - diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.nasm b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLShiftS64.nasm similarity index 100% rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.nasm rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLShiftS64.nasm diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.nasm b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathRShiftU64.nasm similarity index 100% rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.nasm rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathRShiftU64.nasm -- 2.35.1