diff -urN linux-2.2.14/arch/alpha/kernel/alpha_ksyms.c linux-2.2.14.SuSE/arch/alpha/kernel/alpha_ksyms.c --- linux-2.2.14/arch/alpha/kernel/alpha_ksyms.c Tue Jan 4 23:15:00 2000 +++ linux-2.2.14.SuSE/arch/alpha/kernel/alpha_ksyms.c Tue Jan 4 23:42:15 2000 @@ -30,6 +30,7 @@ #include #include #include +#include #define __KERNEL_SYSCALLS__ #include @@ -96,6 +97,7 @@ EXPORT_SYMBOL(__memset); EXPORT_SYMBOL(__memsetw); EXPORT_SYMBOL(__constant_c_memset); +EXPORT_SYMBOL(___delay); EXPORT_SYMBOL(dump_thread); EXPORT_SYMBOL(dump_fpu); diff -urN linux-2.2.14/arch/alpha/kernel/head.S linux-2.2.14.SuSE/arch/alpha/kernel/head.S --- linux-2.2.14/arch/alpha/kernel/head.S Sat Jun 12 20:52:52 1999 +++ linux-2.2.14.SuSE/arch/alpha/kernel/head.S Tue Jan 4 23:42:15 2000 @@ -95,3 +95,21 @@ .prologue 0 call_pal PAL_halt .end halt + + # + # Having the delay loop out of line guarantees that we wont + # run into weird alignment conditions (on new processors) + # that vary the speed of the loop. + # + .align 5 + .globl ___delay + .ent ___delay +___delay: + .set noat + .frame $30,0,$28,0 + .prologue 0 +1: subq $0,1,$0 + bge $0,1b + ret $31,($28),0 + .set at + .end ___delay diff -urN linux-2.2.14/include/asm-alpha/delay.h linux-2.2.14.SuSE/include/asm-alpha/delay.h --- linux-2.2.14/include/asm-alpha/delay.h Tue Jan 4 23:15:04 2000 +++ linux-2.2.14.SuSE/include/asm-alpha/delay.h Tue Jan 4 23:44:49 2000 @@ -9,18 +9,22 @@ * Delay routines, using a pre-computed "loops_per_second" value. */ -/* We can make the delay loop inline, but we have to be very careful - * WRT scheduling for EV6 machines, to keep it consistent for all locations - * of invocations. This is a reasonable compromise. - */ +/* We must make the innermost loop external, ie called via "jsr/bsr", so + that timings will be consistent accross ALL invocations, which is not + the case for a completely inline implementation. */ + +extern void ___delay(void); extern __inline__ void __delay(unsigned long loops) { - __asm__ __volatile__(".align 4\n" - "1:\tsubq %0,1,%0\n\t" - "bge %0,1b\n\t" - "nop": "=r" (loops) : "0" (loops)); + register unsigned long r0 __asm__("$0") = loops; +#ifdef MODULE + __asm__ __volatile__("lda $28,___delay; jsr $28,($28),0" + : "=r"(r0) : "r"(r0) : "$28"); +#else + __asm__ __volatile__("bsr $28,___delay" : "=r"(r0) : "r"(r0) : "$28"); +#endif } /*