lib: add usleep.c (and call its own init from main)
This adds a real usleep implementation. The init function calculates
the "loops per jiffy" variable, by watching the timer ticks before
interrupts are enabled by spll_init(). This init takes 40ms.
Then, the udelay runs the same loop used in calculating lpj, and
is thus correct (it will be slower because we have interrupts running
at run time, but this is not a problem).
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Showing
- include/ppsi-wrappers.h 0 additions, 7 deletionsinclude/ppsi-wrappers.h
- include/syscon.h 6 additions, 0 deletionsinclude/syscon.h
- lib/lib.mk 1 addition, 0 deletionslib/lib.mk
- lib/ptp-noposix-wrappers.c 0 additions, 7 deletionslib/ptp-noposix-wrappers.c
- lib/usleep.c 79 additions, 0 deletionslib/usleep.c
- wrc_main.c 1 addition, 0 deletionswrc_main.c
lib/usleep.c
0 → 100644
Please register or sign in to comment