use get_clock_ms() to calculate a delay in ms Signed-off-by: Pierre Morel <pmorel@xxxxxxxxxxxxx> --- lib/s390x/asm/time.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/s390x/asm/time.h b/lib/s390x/asm/time.h index 25c7a3c..931a119 100644 --- a/lib/s390x/asm/time.h +++ b/lib/s390x/asm/time.h @@ -23,4 +23,14 @@ static inline uint64_t get_clock_ms(void) return (clk >> (63 - 51)) / 1000; } +static inline void mdelay(unsigned long ms) +{ + unsigned long startclk; + + startclk = get_clock_ms(); + for (;;) + if (get_clock_ms() - startclk > ms) + break; +} + #endif -- 2.25.1