diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-18 09:45:08 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-18 09:45:08 -0700 |
commit | 81ce31b773226332475f89501b1072bec0c0e241 (patch) | |
tree | cd66f3c1caf731cc552ae90af2068aecabaed334 /arch/score/lib/cmpdi2.c | |
parent | 515b696b282f856c3ad1679ccd658120faa387d0 (diff) | |
parent | 9973affe9bbcde64041890d8793eb2e74143c298 (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/cmpdi2.c')
-rw-r--r-- | arch/score/lib/cmpdi2.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/score/lib/cmpdi2.c b/arch/score/lib/cmpdi2.c new file mode 100644 index 000000000000..1ed5290c66ed --- /dev/null +++ b/arch/score/lib/cmpdi2.c @@ -0,0 +1,44 @@ +/* + * arch/score/lib/cmpdi2.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 __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); |