diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2008-04-20 09:10:50 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2008-04-20 09:10:50 +0000 |
commit | 2d93f878d281c88557f10020bc0bb6c715aa6ce6 (patch) | |
tree | d1a5f67e1ee7e7ee92764321196de70f27264851 | |
parent | f85cb02b813ff76276041753f812ff61e7d4db1d (diff) | |
download | upstream-2d93f878d281c88557f10020bc0bb6c715aa6ce6.tar.gz upstream-2d93f878d281c88557f10020bc0bb6c715aa6ce6.tar.bz2 upstream-2d93f878d281c88557f10020bc0bb6c715aa6ce6.zip |
[atheros] remove the clz function, use fls instead
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10878 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | target/linux/atheros/files/arch/mips/atheros/ar5315/irq.c | 3 | ||||
-rw-r--r-- | target/linux/atheros/files/include/asm-mips/mach-atheros/ar531x.h | 23 |
2 files changed, 2 insertions, 24 deletions
diff --git a/target/linux/atheros/files/arch/mips/atheros/ar5315/irq.c b/target/linux/atheros/files/arch/mips/atheros/ar5315/irq.c index ed784ba88a..69cb362a00 100644 --- a/target/linux/atheros/files/arch/mips/atheros/ar5315/irq.c +++ b/target/linux/atheros/files/arch/mips/atheros/ar5315/irq.c @@ -20,6 +20,7 @@ #include <linux/kernel.h> #include <linux/reboot.h> #include <linux/interrupt.h> +#include <linux/bitops.h> #include <asm/bootinfo.h> #include <asm/irq_cpu.h> #include <asm/io.h> @@ -39,7 +40,7 @@ static inline void ar5315_gpio_irq(void) if (!pend) return; - do_IRQ(AR531X_GPIO_IRQ_BASE + 31 - clz(pend)); + do_IRQ(AR531X_GPIO_IRQ_BASE + fls(pend) - 1); } diff --git a/target/linux/atheros/files/include/asm-mips/mach-atheros/ar531x.h b/target/linux/atheros/files/include/asm-mips/mach-atheros/ar531x.h index dccf541550..ba52a2b326 100644 --- a/target/linux/atheros/files/include/asm-mips/mach-atheros/ar531x.h +++ b/target/linux/atheros/files/include/asm-mips/mach-atheros/ar531x.h @@ -12,29 +12,6 @@ extern void (*board_time_init)(void); #endif /* - * C access to CLZ instruction - * (count leading zeroes). - */ -static inline int clz(unsigned long val) -{ - int ret; - - __asm__ volatile ( - ".set\tnoreorder\n\t" - ".set\tnoat\n\t" - ".set\tmips32\n\t" - "clz\t%0,%1\n\t" - ".set\tmips0\n\t" - ".set\tat\n\t" - ".set\treorder" - : "=r" (ret) - : "r" (val) - ); - - return ret; -} - -/* * Atheros CPUs before the AR2315 are using MIPS 4Kc core, later designs are * using MIPS 4KEc R2 core. This makes it easy to determine the board at runtime. */ |