aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tsbogend@alpha.franken.de>2008-05-03 18:25:02 -0400
committerRalf Baechle <ralf@linux-mips.org>2008-05-12 11:46:55 -0400
commitfcd84f2fca49166dab2dba259eca6e633585763f (patch)
treece9eb07612fbde779ad80a21ed58b5b300e09f70 /include
parent7ff83f21d23d17b63bbb984fee5d12aa5a8066b3 (diff)
[MIPS] Fix __fls for non-MIPS32/MIPS64 cpus
Only MIPS32 and MIPS64 CPUs implement clz/dclz. Therefore don't export __ilog2() for non MIPS32/MIPS64 cpus and use generic __fls bitop code for these cpus. Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-mips/bitops.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index c2bd126c3b4e..5e1f590a24a1 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -558,6 +558,8 @@ static inline void __clear_bit_unlock(unsigned long nr, volatile unsigned long *
558 __clear_bit(nr, addr); 558 __clear_bit(nr, addr);
559} 559}
560 560
561#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
562
561/* 563/*
562 * Return the bit position (0..63) of the most significant 1 bit in a word 564 * Return the bit position (0..63) of the most significant 1 bit in a word
563 * Returns -1 if no 1 bit exists 565 * Returns -1 if no 1 bit exists
@@ -596,8 +598,6 @@ static inline unsigned long __fls(unsigned long x)
596 return __ilog2(x); 598 return __ilog2(x);
597} 599}
598 600
599#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
600
601/* 601/*
602 * __ffs - find first bit in word. 602 * __ffs - find first bit in word.
603 * @word: The word to search 603 * @word: The word to search
@@ -654,6 +654,7 @@ static inline int ffs(int word)
654#else 654#else
655 655
656#include <asm-generic/bitops/__ffs.h> 656#include <asm-generic/bitops/__ffs.h>
657#include <asm-generic/bitops/__fls.h>
657#include <asm-generic/bitops/ffs.h> 658#include <asm-generic/bitops/ffs.h>
658#include <asm-generic/bitops/fls.h> 659#include <asm-generic/bitops/fls.h>
659#include <asm-generic/bitops/fls64.h> 660#include <asm-generic/bitops/fls64.h>