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.133.124]) by mx.groups.io with SMTP id smtpd.web10.6659.1654259215439563227 for ; Fri, 03 Jun 2022 05:26:55 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ByMll6RS; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654259214; 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=Vboq2TBN+cynXnx+hcKYdkqM3JJsxrTfIgHVORMhK1Y=; b=ByMll6RSCwCYpyw/14SFIUx8sauFi3ljahopAGLul4B1HO2aWY71FhYpW/d2u3ZRjnH2TQ rMHfSlsPkjNRyqI64iii0yi06+HQ8rHbzn8xUHZZIshQq/b80v770T+u/euxm0xQB6sQ2P 95H2NsND898J63WYJSfh/PhUorj0fco= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-626-6xHA0qazNXCGziOx74KmWQ-1; Fri, 03 Jun 2022 08:26:48 -0400 X-MC-Unique: 6xHA0qazNXCGziOx74KmWQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E0742806959; Fri, 3 Jun 2022 12:26:46 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DBB5B7AD8; Fri, 3 Jun 2022 12:26:45 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0A61818009D3; Fri, 3 Jun 2022 14:26:39 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Jian J Wang , Jiaxin Wu , Sean Brogan , Anthony Perard , Leif Lindholm , Zhiguang Liu , Xiaoyu Lu , Pawel Polawski , Sami Mujawar , Maciej Rabeda , Bob Feng , Jiewen Yao , Andrew Fish , Bret Barkelew , Alexei Fedorov , Guo Dong , Gerd Hoffmann , kilian_kegel@hotmail.com, Maurice Ma , Siyuan Fu , Abner Chang , Zhichao Gao , Wei6 Xu , Supreeth Venkatesh , Julien Grall , Daniel Schaefer , Ard Biesheuvel , Guomin Jiang , Jordan Justen , Oliver Steffen , Sebastien Boeuf , Benjamin You , Min Xu , Ray Ni , Rebecca Cran , Nickle Wang , Michael D Kinney , Tom Lendacky , Sami Mujawar , Peter Grehan , Erdem Aktas , Brijesh Singh , James Bottomley , Yuwei Chen , Liming Gao , Jiewen Yao , Ard Biesheuvel Subject: [PATCH v4 4/9] MdePkg/CompilerIntrinsicsLib: move ia32 intrinsics and strcmp Date: Fri, 3 Jun 2022 14:26:33 +0200 Message-Id: <20220603122638.1547060-5-kraxel@redhat.com> In-Reply-To: <20220603122638.1547060-1-kraxel@redhat.com> References: <20220603122638.1547060-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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"; x-default=true 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 Acked-by: Jiewen Yao Acked-by: Ard Biesheuvel Acked-by: Liming Gao --- 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/IntelTdx/IntelTdxX64.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 | 69 ----------------- .../CompilerIntrinsicsLib.inf | 16 ++++ 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 .../CompilerIntrinsicsLib}/Ia32/MathLlmul.asm | 0 .../CompilerIntrinsicsLib}/Ia32/MathLlshr.asm | 0 .../Ia32/MathRShiftU64.nasm | 0 30 files changed, 75 insertions(+), 233 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/MathLlmul.asm (100%) rename {CryptoPkg/Library/IntrinsicLib => MdePkg/Library/CompilerIntrinsicsLib}/Ia32/MathLlshr.asm (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 4b5687927ae8..cc960cf103d2 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -153,7 +153,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 71679687a8b1..4db8de2e5de8 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 4cf886b9eac7..e460e925a988 100644 --- a/EmulatorPkg/EmulatorPkg.dsc +++ b/EmulatorPkg/EmulatorPkg.dsc @@ -129,7 +129,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 fc1fdb2e2297..c0bcc14c6ee6 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.dsc +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc @@ -188,7 +188,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 f0166e136cd1..e7b38222ebd6 100644 --- a/OvmfPkg/Bhyve/BhyveX64.dsc +++ b/OvmfPkg/Bhyve/BhyveX64.dsc @@ -187,7 +187,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 92664f319be2..f1d1a1e946b2 100644 --- a/OvmfPkg/CloudHv/CloudHvX64.dsc +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc @@ -198,7 +198,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/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX64.dsc index dd8d446f4a56..daeb7cb27cbe 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc @@ -175,7 +175,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/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc index f8fc977cb205..edaec5995f0e 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -195,7 +195,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 a9841cbfc3ca..0abcbf2c2143 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -195,7 +195,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 f7949780fa38..8c072eac5d4c 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -199,7 +199,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 1448f925b782..212bdab722d5 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -215,7 +215,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 6ba4bd729ae7..ad88ede14b26 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -184,7 +184,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 4d9bbc80c866..3f20d691fc6e 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -182,7 +182,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 86e74b57b109..000000000000 --- a/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf +++ /dev/null @@ -1,69 +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/MathLlmul.asm | MSFT - Ia32/MathLlshr.asm | 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 a1559fc40ce9..7267d0e3154d 100644 --- a/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf +++ b/MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf @@ -26,6 +26,8 @@ [Sources] memcmp_ms.c | MSFT memmove_ms.c | MSFT + strcmp.c + [Sources.ARM] Arm/ashrdi3.S | GCC Arm/ashldi3.S | GCC @@ -67,6 +69,20 @@ [Sources.ARM] [Sources.AARCH64] AArch64/Atomics.S | GCC +[Sources.IA32] + Ia32/MathLShiftS64.c | MSFT + Ia32/MathRShiftU64.c | MSFT + Ia32/MathFtol.c | MSFT + Ia32/MathLlmul.asm | MSFT + Ia32/MathLlshr.asm | 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/MathLlmul.asm b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLlmul.asm similarity index 100% rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathLlmul.asm rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLlmul.asm diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathLlshr.asm b/MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLlshr.asm similarity index 100% rename from CryptoPkg/Library/IntrinsicLib/Ia32/MathLlshr.asm rename to MdePkg/Library/CompilerIntrinsicsLib/Ia32/MathLlshr.asm 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.36.1