0001
0002
0003
0004
0005
0006
0007
0008 #ifndef __SPARC_DELAY_H
0009 #define __SPARC_DELAY_H
0010
0011 #include <asm/cpudata.h>
0012
0013 static inline void __delay(unsigned long loops)
0014 {
0015 __asm__ __volatile__("cmp %0, 0\n\t"
0016 "1: bne 1b\n\t"
0017 "subcc %0, 1, %0\n" :
0018 "=&r" (loops) :
0019 "0" (loops) :
0020 "cc");
0021 }
0022
0023
0024 void __udelay(unsigned long usecs, unsigned long lpj);
0025 void __ndelay(unsigned long nsecs, unsigned long lpj);
0026
0027 #ifdef CONFIG_SMP
0028 #define __udelay_val cpu_data(smp_processor_id()).udelay_val
0029 #else
0030 #define __udelay_val loops_per_jiffy
0031 #endif
0032 #define udelay(__usecs) __udelay(__usecs, __udelay_val)
0033 #define ndelay(__nsecs) __ndelay(__nsecs, __udelay_val)
0034
0035 #endif