summaryrefslogtreecommitdiffstats
path: root/CryptoPkg/Library/IntrinsicLib/Ia32/MathDivU64x64.c
diff options
context:
space:
mode:
Diffstat (limited to 'CryptoPkg/Library/IntrinsicLib/Ia32/MathDivU64x64.c')
-rw-r--r--CryptoPkg/Library/IntrinsicLib/Ia32/MathDivU64x64.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathDivU64x64.c b/CryptoPkg/Library/IntrinsicLib/Ia32/MathDivU64x64.c
new file mode 100644
index 0000000000..dbb7b516fb
--- /dev/null
+++ b/CryptoPkg/Library/IntrinsicLib/Ia32/MathDivU64x64.c
@@ -0,0 +1,22 @@
+/** @file
+ 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) 2023, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Library/BaseLib.h>
+
+/* https://gcc.gnu.org/onlinedocs/gccint/Integer-library-routines.html */
+__attribute__ ((__used__))
+unsigned long long
+__udivdi3 (
+ unsigned long long A,
+ unsigned long long B
+ )
+{
+ return DivU64x64Remainder ((UINT64)A, (UINT64)B, NULL);
+}