adds ndelay function (just like udelay)
PATCH 1/1 adds ndelay function (just like udelay)
Though most cpu's do not support delay of such resolution it is prudent to insert this delay where the hardware specs demands it.
Signed-off-by Eran Liberty <[email protected]>
time.c +10 -1
@@ -53,8 +53,17 @@*/ void udelay (unsigned long usec) { -ulong ticks =usec2ticks (usec); +ulong ticks =usec2ticks (usec); +wait_ticks (ticks); +} + +/* ------------------------------------------------------------------------- */ + +void ndelay (unsigned long nsec) +{ +ulong ticks =usec2ticks (1 ) * nsec /1000 +1 ; +wait_ticks (ticks); }
exports.h +1 -0
@@ -17,6 +17,7 @@void *malloc (size_t );void free (void *);void udelay (unsigned long ); +void ndelay (unsigned long );unsigned long get_timer (unsigned long );void vprintf (const char *,va_list );void do_reset (void );
common.h +1 -0
@@ -559,6 +559,7 @@/* lib_$(ARCH)/time.c */ void udelay (unsigned long ); +void ndelay (unsigned long );ulong usec2ticks (unsigned long usec);ulong ticks2usec (unsigned long ticks);int init_timebase (void );
PATCH 1/1 adds ndelay function (just like udelay)
Quoted 4 lines · eran.liberty at gmail.com
Though most cpu's do not support delay of such resolution it is prudent to insert this delay where the hardware specs demands it.
Signed-off-by Eran Liberty <[email protected]>
Yeah, okay. Looks pretty benign, but could cause confusion when high resolution delays are not available.
Acked-by Grant Likely <[email protected]>
Cheers,
g.
Signature · 4 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. grant.likely at secretlab.ca (403) 399-0195