Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / arch / loongarch / include / asm / delay.h
blob36d7751913106344ba21226483b5936c8871ccbb
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
4 */
5 #ifndef _ASM_DELAY_H
6 #define _ASM_DELAY_H
8 #include <linux/param.h>
10 extern void __delay(unsigned long cycles);
11 extern void __ndelay(unsigned long ns);
12 extern void __udelay(unsigned long us);
14 #define ndelay(ns) __ndelay(ns)
15 #define udelay(us) __udelay(us)
17 /* make sure "usecs *= ..." in udelay do not overflow. */
18 #if HZ >= 1000
19 #define MAX_UDELAY_MS 1
20 #elif HZ <= 200
21 #define MAX_UDELAY_MS 5
22 #else
23 #define MAX_UDELAY_MS (1000 / HZ)
24 #endif
26 #endif /* _ASM_DELAY_H */