summaryrefslogtreecommitdiffstats
path: root/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
diff options
context:
space:
mode:
authorNickle Wang <nicklew@nvidia.com>2024-02-15 18:58:50 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-02-29 03:25:18 +0000
commitd9a6e7b0b8a67392a57788d97634256546207a64 (patch)
tree521c4300c8b5362bff2bbaa97a1610e6557e7c43 /RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
parentd4c76fa17d9caccb48926a20404512cc7c371684 (diff)
downloadedk2-d9a6e7b0b8a67392a57788d97634256546207a64.tar.gz
edk2-d9a6e7b0b8a67392a57788d97634256546207a64.tar.bz2
edk2-d9a6e7b0b8a67392a57788d97634256546207a64.zip
RedfishPkg/RedfishCrtLib: fix unresolved external symbol issue
-Fix below compiler error reported in edk2 CI. ERROR - Linker #2001 from JsonLib.lib(load.obj) : unresolved external symbol __ftol2 -The file MathFtol.c is copied from IntrinsicLib in CryptoPkg. -Add MathFtol.c to EccCheck IgnoreFiles. Signed-off-by: Nickle Wang <nicklew@nvidia.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nick Ramirez <nramirez@nvidia.com> Reviewed-by: Abner Chang <abner.chang@amd.com> Reviewed-by: Igor Kulchytskyy <igork@ami.com>
Diffstat (limited to 'RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c')
-rw-r--r--RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c b/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
new file mode 100644
index 0000000000..e49f00eaf5
--- /dev/null
+++ b/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
@@ -0,0 +1,37 @@
+/** @file This file is copied from CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c
+ 64-bit Math Worker Function.
+ The 32-bit versions of C compiler generate calls to library routines
+ to handle 64-bit math. These functions use non-standard calling conventions.
+
+Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+/*
+ * Floating point to integer conversion.
+ */
+__declspec(naked) void
+_ftol2 (
+ void
+ )
+{
+ _asm {
+ fistp qword ptr [esp-8]
+ mov edx, [esp-4]
+ mov eax, [esp-8]
+ ret
+ }
+}
+
+__declspec(naked) void
+_ftol2_sse (
+ void
+ )
+{
+ _asm {
+ fistp dword ptr [esp-4]
+ mov eax,[esp-4]
+ ret
+ }
+}