From: Vineet Gupta <vgu...@kernel.org> Add __delay implementation based on DBNZ if ZOL is not supported.
Signed-off-by: Vineet Gupta <vgu...@kernel.org> --- arch/arc/include/asm/delay.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arc/include/asm/delay.h b/arch/arc/include/asm/delay.h index 54db798f0aa0..e061d1c64f24 100644 --- a/arch/arc/include/asm/delay.h +++ b/arch/arc/include/asm/delay.h @@ -16,9 +16,12 @@ #include <asm-generic/types.h> #include <asm/param.h> /* HZ */ +#include <asm/assembler.h> extern unsigned long loops_per_jiffy; +#ifndef CONFIG_ARC_LACKS_ZOL + static inline void __delay(unsigned long loops) { __asm__ __volatile__( @@ -31,6 +34,19 @@ static inline void __delay(unsigned long loops) : "lp_count"); } +#else + +static inline void __delay(unsigned long loops) +{ + __asm__ __volatile__( + " add %0, %0, 1 \n" + "1: nop \n" + " DBNZR %0, 1b \n" + : "+r"(loops)); +} + +#endif + extern void __bad_udelay(void); /* -- 2.25.1 _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc