5 * Copyright (C) 1998, 1999, 2000, 2001 Axis Communications AB
7 * Delay routines, using a pre-computed "loops_per_second" value.
10 #include <linux/config.h>
11 #include <linux/linkage.h>
17 extern void __do_delay(void); /* Special register call calling convention */
19 extern __inline__ void __delay(int loops)
21 __asm__ __volatile__ (
29 : : "g" (loops) : "r9");
33 /* Use only for very small delays ( < 1 msec). */
35 extern unsigned long loops_per_usec; /* arch/cris/mm/init.c */
37 extern __inline__ void udelay(unsigned long usecs)
39 __delay(usecs * loops_per_usec);
42 /* ETRAX 100 is really too slow to sleep for nanosecs. */
43 /* Divide with 1024 to avoid a real division that would take >1 us... */
44 extern __inline__ void ndelay(unsigned long nsecs)
46 __delay(1 + nsecs * loops_per_usec / 1024);
49 #endif /* defined(_CRIS_DELAY_H) */