Exemplo n.º 1
0
Arquivo: timer.c Projeto: kyuh/ChingOS
/*! Busy-waits for approximately MS milliseconds.  Interrupts need not be
    turned on.

    Busy waiting wastes CPU cycles, and busy waiting with interrupts off for
    the interval between timer ticks or longer will cause timer ticks to be
    lost.  Thus, use timer_msleep() instead if interrupts are enabled. */
void timer_mdelay(int64_t ms) {
    real_time_delay(ms, 1000);
}
Exemplo n.º 2
0
Arquivo: timer.c Projeto: kyuh/ChingOS
/*! Sleeps for approximately US microseconds.  Interrupts need not be turned on.

    Busy waiting wastes CPU cycles, and busy waiting with interrupts off for
    the interval between timer ticks or longer will cause timer ticks to be
    lost.  Thus, use timer_usleep() instead if interrupts are enabled. */
void timer_udelay(int64_t us) {
    real_time_delay(us, 1000 * 1000);
}
Exemplo n.º 3
0
/* Sleeps execution for approximately NS nanoseconds.  Interrupts
   need not be turned on.
   Busy waiting wastes CPU cycles, and busy waiting with
   interrupts off for the interval between timer ticks or longer
   will cause timer ticks to be lost.  Thus, use timer_nsleep()
   instead if interrupts are enabled.*/
void
timer_ndelay (int64_t ns) 
{
  real_time_delay (ns, 1000 * 1000 * 1000);
}