1 /* $Id: delay.h,v 1.8 1996/01/28 02:09:21 davem Exp $
2 * delay.h: Linux delay routines on the Sparc.
3 *
4 * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu).
5 */
6
7 #ifndef __SPARC_DELAY_H
8 #define __SPARC_DELAY_H
9
10 extern unsigned long loops_per_sec;
11
12 extern __inline__ void __delay(unsigned long loops)
/* ![[previous]](../icons/n_left.png)
![[next]](../icons/n_right.png)
![[first]](../icons/n_first.png)
![[last]](../icons/n_last.png)
![[top]](../icons/top.png)
![[bottom]](../icons/bottom.png)
![[index]](../icons/index.png)
*/
13 {
14 __asm__ __volatile__("cmp %0, 0\n\t"
15 "1: bne 1b\n\t"
16 "subcc %0, 1, %0\n" :
17 "=&r" (loops) :
18 "0" (loops));
19 }
20
21 /* This is too messy with inline asm on the Sparc. */
22 extern void udelay(unsigned long usecs);
23
24 /* calibrate_delay() wants this... */
25 #define muldiv(a, b, c) (((a)*(b))/(c))
26
27 #endif /* defined(__SPARC_DELAY_H) */
28