diff -urN 2.4.6pre2/arch/alpha/kernel/alpha_ksyms.c udelay/arch/alpha/kernel/alpha_ksyms.c --- 2.4.6pre2/arch/alpha/kernel/alpha_ksyms.c Sat May 26 04:03:35 2001 +++ udelay/arch/alpha/kernel/alpha_ksyms.c Wed Jun 13 03:28:04 2001 @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -100,6 +101,9 @@ EXPORT_SYMBOL(__constant_c_memset); EXPORT_SYMBOL(copy_page); EXPORT_SYMBOL(clear_page); + +EXPORT_SYMBOL(__delay); +EXPORT_SYMBOL(udelay); EXPORT_SYMBOL(__direct_map_base); EXPORT_SYMBOL(__direct_map_size); diff -urN 2.4.6pre2/arch/alpha/lib/Makefile udelay/arch/alpha/lib/Makefile --- 2.4.6pre2/arch/alpha/lib/Makefile Thu Feb 22 03:44:53 2001 +++ udelay/arch/alpha/lib/Makefile Wed Jun 13 03:27:42 2001 @@ -21,6 +21,7 @@ endif OBJS = __divqu.o __remqu.o __divlu.o __remlu.o \ + udelay.o \ $(ev6)memset.o \ $(ev6)memcpy.o \ memmove.o \ diff -urN 2.4.6pre2/arch/alpha/lib/udelay.c udelay/arch/alpha/lib/udelay.c --- 2.4.6pre2/arch/alpha/lib/udelay.c Thu Jan 1 01:00:00 1970 +++ udelay/arch/alpha/lib/udelay.c Wed Jun 13 03:27:56 2001 @@ -0,0 +1,47 @@ +#include +#include /* for udelay's use of smp_processor_id */ +#include +#include +#include + +/* + * Copyright (C) 1993, 2000 Linus Torvalds + * + * Delay routines, using a pre-computed "loops_per_jiffy" value. + */ + +/* + * Use only for very small delays (< 1 msec). + * + * The active part of our cycle counter is only 32-bits wide, and + * we're treating the difference between two marks as signed. On + * a 1GHz box, that's about 2 seconds. + */ + +void __delay(int loops) +{ + int tmp; + __asm__ __volatile__( + " rpcc %0\n" + " addl %1,%0,%1\n" + "1: rpcc %0\n" + " subl %1,%0,%0\n" + " bgt %0,1b" + : "=&r" (tmp), "=r" (loops) : "1"(loops)); +} + +static void __udelay(unsigned long usecs, unsigned long lpj) +{ + usecs *= (((unsigned long)HZ << 32) / 1000000) * lpj; + __delay((long)usecs >> 32); +} + +void udelay(unsigned long usecs) +{ +#ifdef CONFIG_SMP + __udelay(usecs, cpu_data[smp_processor_id()].loops_per_jiffy); +#else + __udelay(usecs, loops_per_jiffy); +#endif +} + diff -urN 2.4.6pre2/include/asm-alpha/delay.h udelay/include/asm-alpha/delay.h --- 2.4.6pre2/include/asm-alpha/delay.h Sun Apr 1 20:11:27 2001 +++ udelay/include/asm-alpha/delay.h Wed Jun 13 03:28:17 2001 @@ -1,48 +1,7 @@ #ifndef __ALPHA_DELAY_H #define __ALPHA_DELAY_H -#include -#include -#include - -/* - * Copyright (C) 1993, 2000 Linus Torvalds - * - * Delay routines, using a pre-computed "loops_per_jiffy" value. - */ - -/* - * Use only for very small delays (< 1 msec). - * - * The active part of our cycle counter is only 32-bits wide, and - * we're treating the difference between two marks as signed. On - * a 1GHz box, that's about 2 seconds. - */ - -extern __inline__ void -__delay(int loops) -{ - int tmp; - __asm__ __volatile__( - " rpcc %0\n" - " addl %1,%0,%1\n" - "1: rpcc %0\n" - " subl %1,%0,%0\n" - " bgt %0,1b" - : "=&r" (tmp), "=r" (loops) : "1"(loops)); -} - -extern __inline__ void -__udelay(unsigned long usecs, unsigned long lpj) -{ - usecs *= (((unsigned long)HZ << 32) / 1000000) * lpj; - __delay((long)usecs >> 32); -} - -#ifdef CONFIG_SMP -#define udelay(u) __udelay((u), cpu_data[smp_processor_id()].loops_per_jiffy) -#else -#define udelay(u) __udelay((u), loops_per_jiffy) -#endif +extern void __delay(int loops); +extern void udelay(unsigned long usecs); #endif /* defined(__ALPHA_DELAY_H) */