summaryrefslogtreecommitdiff
path: root/RedfishPkg/PrivateLibrary/RedfishCrtLib
diff options
context:
space:
mode:
Diffstat (limited to 'RedfishPkg/PrivateLibrary/RedfishCrtLib')
-rw-r--r--RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c37
-rw-r--r--RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf7
2 files changed, 43 insertions, 1 deletions
diff --git a/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c b/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
new file mode 100644
index 0000000..e49f00e
--- /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
+ }
+}
diff --git a/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf b/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
index 6ff5dba..3a5e309 100644
--- a/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
+++ b/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
@@ -3,6 +3,7 @@
#
# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -23,6 +24,9 @@
[Sources]
RedfishCrtLib.c
+[Sources.IA32]
+ Ia32/MathFtol.c | MSFT
+
[LibraryClasses]
BaseLib
SortLib
@@ -35,4 +39,5 @@
MdeModulePkg/MdeModulePkg.dec
RedfishPkg/RedfishPkg.dec
-
+[BuildOptions]
+ MSFT:*_*_IA32_CC_FLAGS = /GL-