summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorJorgen Lundman <[email protected]>2012-05-02 00:15:28 +0000
committerBrian Behlendorf <[email protected]>2012-05-03 10:07:54 -0700
commitef6f91ce0c96f7440a6fab23cb605a7f67185790 (patch)
tree7e6898dff64b9e6a5423cff4e324e7c45d749ade /module
parentcb75844e859f1b97294f53e8370d8e5110b14779 (diff)
Add missing 64-bit divide for 32-bit ARM
Leverage the existing generic 64-bit division operations which were originally implemented for x86 to support ARM. All that is required is to make the symbols available to the linker with the expected names. Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'module')
-rw-r--r--module/spl/spl-generic.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c
index be099aaae..d22100ea3 100644
--- a/module/spl/spl-generic.c
+++ b/module/spl/spl-generic.c
@@ -183,7 +183,7 @@ __udivdi3(uint64_t u, uint64_t v)
q0 = q0 - 1; // too small by 1.
if ((u - q0 * v) >= v)
q0 = q0 + 1; // Now q0 is correct.
-
+
return q0;
}
}
@@ -212,6 +212,27 @@ __umoddi3(uint64_t dividend, uint64_t divisor)
}
EXPORT_SYMBOL(__umoddi3);
+#if defined(__arm) || defined(__arm__)
+/*
+ * Implementation of 64-bit unsigned division for 32-bit arm machines.
+ */
+uint64_t
+__aeabi_uldivmod(uint64_t u, uint64_t v)
+{
+ return __udivdi3(u, v);
+}
+EXPORT_SYMBOL(__aeabi_uldivmod);
+
+/*
+ * Implementation of 64-bit signed division for 32-bit arm machines.
+ */
+int64_t
+__aeabi_ldivmod(int64_t u, int64_t v)
+{
+ return __divdi3(u, v);
+}
+EXPORT_SYMBOL(__aeabi_ldivmod);
+#endif /* __arm || __arm__ */
#endif /* BITS_PER_LONG */
/* NOTE: The strtoxx behavior is solely based on my reading of the Solaris