void ndelay (unsigned long nsec) /* delay in nano-seconds */ { u64 delta = usec_to_tick(nsec); /* time to wait */ delta /= 1000ull; /* remember: nsec not usec ! */ tick_delay (delta); /* wait ... */ }
void __weak __udelay(unsigned long usec) { uint64_t tmp; tmp = get_ticks() + usec_to_tick(usec); /* get current timestamp */ while (get_ticks() < tmp+1) /* loop till event */ /*NOP*/; }
void __udelay(unsigned long usec) { unsigned long long start; ulong tmo; start = get_ticks(); /* get current timestamp */ tmo = usec_to_tick(usec); /* convert usecs to ticks */ while ((get_ticks() - start) < tmo) ; /* loop till time has passed */ }
void udelay(unsigned long usec) { unsigned long long tmp; ulong tmo; tmo = usec_to_tick(usec); tmp = get_ticks() + tmo; /* get current timestamp */ while (get_ticks() < tmp) /* loop till event */ /*NOP*/; }
void rockchip_udelay(unsigned int usec) { uint64_t tmp; /* get timestamp */ tmp = rockchip_get_ticks() + usec_to_tick(usec); /* loop till event */ while (rockchip_get_ticks() < tmp+1) ; }
/* delay x useconds */ void __udelay(unsigned long usec) { long long tmo; long long now, last; tmo = usec_to_tick(usec); /* get current timestamp */ last = get_rk_current_tick(); while (tmo > 0) /* loop till event */ { now = get_rk_current_tick(); if (last >= now) { tmo -= last - now; } else { tmo -= 0xFFFFFFFF + last - now; } last = now; } }
void udelay (unsigned long usec) /* delay in micro-seconds */ { u64 delta = usec_to_tick(usec); /* time to wait */ tick_delay (delta); /* wait ... */ }