Skip to content

Commit f0fbf0a

Browse files
glommerIngo Molnar
authored andcommitted
x86: integrate delay functions.
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>
1 parent 7e58818 commit f0fbf0a

3 files changed

Lines changed: 6 additions & 135 deletions

File tree

‎arch/x86/lib/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

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

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/* simple loop based delay: */
3030
static void delay_loop(unsigned long loops)
3131
{
32-
__asm__ __volatile__(
32+
asm volatile(
3333
" test %0,%0 \n"
3434
" jz 3f \n"
3535
" jmp 1f \n"
@@ -108,31 +108,30 @@ void __delay(unsigned long loops)
108108
{
109109
delay_fn(loops);
110110
}
111+
EXPORT_SYMBOL(__delay);
111112

112113
inline void __const_udelay(unsigned long xloops)
113114
{
114115
int d0;
115116

116117
xloops *= 4;
117-
__asm__("mull %%edx"
118+
asm("mull %%edx"
118119
:"=d" (xloops), "=&a" (d0)
119120
:"1" (xloops), "0"
120121
(cpu_data(raw_smp_processor_id()).loops_per_jiffy * (HZ/4)));
121122

122123
__delay(++xloops);
123124
}
125+
EXPORT_SYMBOL(__const_udelay);
124126

125127
void __udelay(unsigned long usecs)
126128
{
127129
__const_udelay(usecs * 0x000010c7); /* 2**32 / 1000000 (rounded up) */
128130
}
131+
EXPORT_SYMBOL(__udelay);
129132

130133
void __ndelay(unsigned long nsecs)
131134
{
132135
__const_udelay(nsecs * 0x00005); /* 2**32 / 1000000000 (rounded up) */
133136
}
134-
135-
EXPORT_SYMBOL(__delay);
136-
EXPORT_SYMBOL(__const_udelay);
137-
EXPORT_SYMBOL(__udelay);
138137
EXPORT_SYMBOL(__ndelay);

‎arch/x86/lib/delay_64.c‎

Lines changed: 0 additions & 128 deletions
This file was deleted.

0 commit comments

Comments
 (0)