aboutsummaryrefslogtreecommitdiff
path: root/arch/score/lib/ucmpdi2.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-18 09:45:08 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-18 09:45:08 -0700
commit81ce31b773226332475f89501b1072bec0c0e241 (patch)
treecd66f3c1caf731cc552ae90af2068aecabaed334 /arch/score/lib/ucmpdi2.c
parent515b696b282f856c3ad1679ccd658120faa387d0 (diff)
parent9973affe9bbcde64041890d8793eb2e74143c298 (diff)
Merge branch 'for-linus' of git://gitserver.sunplusct.com/linux-2.6-score
* 'for-linus' of git://gitserver.sunplusct.com/linux-2.6-score: (22 commits) score: add TIF_NOTIFY_RESUME define in asm/thread_info.h score: make init_thread_union align to THREAD_SIZE score: update files according to review comments. score: add old syscall support score: add MEMORY_START and MEMORY_SIZE define, to make the code clear score: update inconsistent declare after .c was changed score: remove unused code, add include files in .c score: clean up mm/init.c score: make irq.h definitions local score: cleanups: dead code, 0 as pointer, shadowed variables score: fix function prototypes score: add address space annotations score: add missing #includes score: move save arg5 and arg6 instruction in front of enable_irq score: add prototypes for wrapped syscalls score: remove init_mm score: add generic sys_call_table score: remove __{put,get}_user_unknown score: unset __ARCH_WANT_IPC_PARSE_VERSION score: update files according to review comments ...
Diffstat (limited to 'arch/score/lib/ucmpdi2.c')
-rw-r--r--arch/score/lib/ucmpdi2.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/score/lib/ucmpdi2.c b/arch/score/lib/ucmpdi2.c
new file mode 100644
index 00000000000..b15241e0b07
--- /dev/null
+++ b/arch/score/lib/ucmpdi2.c
@@ -0,0 +1,38 @@
+/*
+ * arch/score/lib/ucmpdi2.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see the file COPYING, or write
+ * to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <linux/module.h>
+#include "libgcc.h"
+
+word_type __ucmpdi2(unsigned long long a, unsigned long long b)
+{
+ const DWunion au = {.ll = a};
+ const DWunion bu = {.ll = b};
+
+ if ((unsigned int) au.s.high < (unsigned int) bu.s.high)
+ return 0;
+ else if ((unsigned int) au.s.high > (unsigned int) 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(__ucmpdi2);