summaryrefslogtreecommitdiff
path: root/arch/score/include/asm/delay.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/score/include/asm/delay.h')
-rw-r--r--arch/score/include/asm/delay.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/score/include/asm/delay.h b/arch/score/include/asm/delay.h
new file mode 100644
index 00000000000..ad716f6d922
--- /dev/null
+++ b/arch/score/include/asm/delay.h
@@ -0,0 +1,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 */