summaryrefslogtreecommitdiff
path: root/arch/microblaze/lib/cmpdi2.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 17:37:49 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 17:37:49 -0800
commit4690dfa8cd66c37fbe99bb8cd5baa86102110776 (patch)
tree063d1f68298cab19d29a4aa689d755266ae85a7d /arch/microblaze/lib/cmpdi2.c
parentc2e08e7ce5ab25a781197a71c5241742e8c9fdfe (diff)
parentf3aef2510e2bb28cdbf32e5f3b8f04f03336ac81 (diff)
Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
* 'next' of git://git.monstr.eu/linux-2.6-microblaze: microblaze: Wire-up new system calls microblaze: Remove NO_IRQ from architecture input: xilinx_ps2: Don't use NO_IRQ block: xsysace: Don't use NO_IRQ microblaze: Trivial asm fix microblaze: Fix debug message in module microblaze: Remove eprintk macro microblaze: Send CR before LF for early console microblaze: Change NO_IRQ to 0 microblaze: Use irq_of_parse_and_map for timer microblaze: intc: Change variable name microblaze: Use of_find_compatible_node for timer and intc microblaze: Add __cmpdi2 microblaze: Synchronize __pa __va macros
Diffstat (limited to 'arch/microblaze/lib/cmpdi2.c')
-rw-r--r--arch/microblaze/lib/cmpdi2.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/microblaze/lib/cmpdi2.c b/arch/microblaze/lib/cmpdi2.c
new file mode 100644
index 00000000000..a708400ea7b
--- /dev/null
+++ b/arch/microblaze/lib/cmpdi2.c
@@ -0,0 +1,26 @@
+#include <linux/module.h>
+
+#include "libgcc.h"
+
+word_type __cmpdi2(long long a, long long b)
+{
+ const DWunion au = {
+ .ll = a
+ };
+ const DWunion bu = {
+ .ll = b
+ };
+
+ if (au.s.high < bu.s.high)
+ return 0;
+ else if (au.s.high > bu.s.high)
+ return 2;
+
+ if ((unsigned int) au.s.low < (unsigned int) bu.s.low)
+ return 0;
+ else if ((unsigned int) au.s.low > (unsigned int) bu.s.low)
+ return 2;
+
+ return 1;
+}
+EXPORT_SYMBOL(__cmpdi2);