diff options
-rw-r--r-- | arch/hexagon/include/asm/delay.h | 1 | ||||
-rw-r--r-- | arch/hexagon/kernel/time.c | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/arch/hexagon/include/asm/delay.h b/arch/hexagon/include/asm/delay.h index 53079719d667..8933b9b1a3bf 100644 --- a/arch/hexagon/include/asm/delay.h +++ b/arch/hexagon/include/asm/delay.h @@ -21,6 +21,7 @@ #include <asm/param.h> +extern void __delay(unsigned long cycles); extern void __udelay(unsigned long usecs); #define udelay(usecs) __udelay((usecs)) diff --git a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c index d0c4f5a04b7b..17fbf45bf150 100644 --- a/arch/hexagon/kernel/time.c +++ b/arch/hexagon/kernel/time.c @@ -229,6 +229,15 @@ void __init time_init(void) late_time_init = time_init_deferred; } +void __delay(unsigned long cycles) +{ + unsigned long long start = __vmgettime(); + + while ((__vmgettime() - start) < cycles) + cpu_relax(); +} +EXPORT_SYMBOL(__delay); + /* * This could become parametric or perhaps even computed at run-time, * but for now we take the observed simulator jitter. |