summaryrefslogtreecommitdiffstats
path: root/arch/parisc/lib/libgcc/__moddi3.c
diff options
context:
space:
mode:
authorKyle McMartin <kyle@mcmartin.ca>2007-10-18 00:06:26 -0700
committerKyle McMartin <kyle@shortfin.cabal.ca>2007-10-18 00:58:49 -0700
commitefb80e7e097d0888e59fbbe4ded2ac5a256f556d (patch)
tree98a0f2f1514501aeebb1877bfcb5b528491e5ad5 /arch/parisc/lib/libgcc/__moddi3.c
parent6f7d998e94ec7b7f08bd0c72fc05343435d7fa93 (diff)
downloadop-kernel-dev-efb80e7e097d0888e59fbbe4ded2ac5a256f556d.zip
op-kernel-dev-efb80e7e097d0888e59fbbe4ded2ac5a256f556d.tar.gz
[PARISC] import necessary bits of libgcc.a
Currently we're hacking libs-y to include libgcc.a, but this has unforeseen consequences since the userspace libgcc is linked with fpregs enabled. We need the kernel to stop using fpregs in an uncontrolled manner to implement lazy fpu state saves. Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Diffstat (limited to 'arch/parisc/lib/libgcc/__moddi3.c')
-rw-r--r--arch/parisc/lib/libgcc/__moddi3.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/parisc/lib/libgcc/__moddi3.c b/arch/parisc/lib/libgcc/__moddi3.c
new file mode 100644
index 0000000..ed64bba
--- /dev/null
+++ b/arch/parisc/lib/libgcc/__moddi3.c
@@ -0,0 +1,23 @@
+#include "libgcc.h"
+
+s64 __moddi3(s64 num, s64 den)
+{
+ int minus = 0;
+ s64 v;
+
+ if (num < 0) {
+ num = -num;
+ minus = 1;
+ }
+ if (den < 0) {
+ den = -den;
+ minus ^= 1;
+ }
+
+ (void)__udivmoddi4(num, den, (u64 *) & v);
+ if (minus)
+ v = -v;
+
+ return v;
+}
+EXPORT_SYMBOL(__moddi3);
OpenPOWER on IntegriCloud