Writing Device Drivers


These are delay and time value conversion routines.

void delay(clock_t ticks);

delay(9F) blocks the calling thread for at least ticks clock ticks (timeout(9F)).

void drv_usecwait(clock_t microsecs);

drv_usecwait(9F) busy-waits for microsecs microseconds.

clock_t drv_hztousec(clock_t hertz);

drv_hztousec(9F) converts hertz clock ticks to microseconds, and returns the number of microseconds.

clock_t drv_usectohz(clock_t microsecs);

drv_usectohz(9F) converts microsecs microseconds to clock ticks, and returns the number of clock ticks.