Skip to content

Commit

Permalink
x86: integrate delay functions.
Browse files Browse the repository at this point in the history
delay_32.c, delay_64.c are now equal, and are integrated into delay.c.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Glauber Costa authored and Ingo Molnar committed Jul 9, 2008
1 parent 7e58818 commit f0fbf0a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 135 deletions.
2 changes: 1 addition & 1 deletion arch/x86/lib/Makefile
Expand Up @@ -4,7 +4,7 @@

obj-$(CONFIG_SMP) := msr-on-cpu.o

lib-y := delay_$(BITS).o
lib-y := delay.o
lib-y += usercopy_$(BITS).o getuser_$(BITS).o putuser_$(BITS).o
lib-y += memcpy_$(BITS).o

Expand Down
11 changes: 5 additions & 6 deletions arch/x86/lib/delay_32.c → arch/x86/lib/delay.c
Expand Up @@ -29,7 +29,7 @@
/* simple loop based delay: */
static void delay_loop(unsigned long loops)
{
__asm__ __volatile__(
asm volatile(
" test %0,%0 \n"
" jz 3f \n"
" jmp 1f \n"
Expand Down Expand Up @@ -108,31 +108,30 @@ void __delay(unsigned long loops)
{
delay_fn(loops);
}
EXPORT_SYMBOL(__delay);

inline void __const_udelay(unsigned long xloops)
{
int d0;

xloops *= 4;
__asm__("mull %%edx"
asm("mull %%edx"
:"=d" (xloops), "=&a" (d0)
:"1" (xloops), "0"
(cpu_data(raw_smp_processor_id()).loops_per_jiffy * (HZ/4)));

__delay(++xloops);
}
EXPORT_SYMBOL(__const_udelay);

void __udelay(unsigned long usecs)
{
__const_udelay(usecs * 0x000010c7); /* 2**32 / 1000000 (rounded up) */
}
EXPORT_SYMBOL(__udelay);

void __ndelay(unsigned long nsecs)
{
__const_udelay(nsecs * 0x00005); /* 2**32 / 1000000000 (rounded up) */
}

EXPORT_SYMBOL(__delay);
EXPORT_SYMBOL(__const_udelay);
EXPORT_SYMBOL(__udelay);
EXPORT_SYMBOL(__ndelay);
128 changes: 0 additions & 128 deletions arch/x86/lib/delay_64.c

This file was deleted.

0 comments on commit f0fbf0a

Please sign in to comment.