summaryrefslogtreecommitdiffstats
path: root/arch/score/include/asm/delay.h
blob: ad716f6d922d20f31232e4ed598909050061158c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef _ASM_SCORE_DELAY_H
#define _ASM_SCORE_DELAY_H

static inline void __delay(unsigned long loops)
{
	__asm__ __volatile__ (
		"1:\tsubi\t%0,1\n\t"
		"cmpz.c\t%0\n\t"
		"bne\t1b\n\t"
		: "=r" (loops)
		: "0" (loops));
}

static inline void __udelay(unsigned long usecs)
{
	__delay(usecs);
}

#define udelay(usecs) __udelay(usecs)

#endif /* _ASM_SCORE_DELAY_H */
OpenPOWER on IntegriCloud