]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c
CryptoPkg/IntrinsicLib: Fix possible unresolved external symbol issue
[mirror_edk2.git] / CryptoPkg / Library / IntrinsicLib / Ia32 / MathFtol.c
diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c b/CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c
new file mode 100644 (file)
index 0000000..147a19a
--- /dev/null
@@ -0,0 +1,22 @@
+/** @file\r
+  64-bit Math Worker Function.\r
+  The 32-bit versions of C compiler generate calls to library routines\r
+  to handle 64-bit math. These functions use non-standard calling conventions.\r
+\r
+Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+/*\r
+ * Floating point to integer conversion.\r
+ */\r
+__declspec(naked) void _ftol2 (void)\r
+{\r
+  _asm {\r
+    fistp qword ptr [esp-8]\r
+    mov   edx, [esp-4]\r
+    mov   eax, [esp-8]\r
+    ret\r
+  }\r
+}\r