mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-25 08:21:14 +00:00
remove the clz function, use fls instead
SVN-Revision: 10878
This commit is contained in:
parent
c55299adb4
commit
1f666fa459
@ -20,6 +20,7 @@
|
|||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/reboot.h>
|
#include <linux/reboot.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
|
#include <linux/bitops.h>
|
||||||
#include <asm/bootinfo.h>
|
#include <asm/bootinfo.h>
|
||||||
#include <asm/irq_cpu.h>
|
#include <asm/irq_cpu.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
@ -39,7 +40,7 @@ static inline void ar5315_gpio_irq(void)
|
|||||||
if (!pend)
|
if (!pend)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
do_IRQ(AR531X_GPIO_IRQ_BASE + 31 - clz(pend));
|
do_IRQ(AR531X_GPIO_IRQ_BASE + fls(pend) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,29 +11,6 @@
|
|||||||
extern void (*board_time_init)(void);
|
extern void (*board_time_init)(void);
|
||||||
#endif
|
#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
|
* 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.
|
* using MIPS 4KEc R2 core. This makes it easy to determine the board at runtime.
|
||||||
|
Loading…
Reference in New Issue
Block a user