MCPcopy Create free account
hub / github.com/HelenOS/helenos / delay

Function delay

kernel/generic/src/time/delay.c:51–63  ·  view source on GitHub ↗

Delay the execution for the given number of microseconds (or slightly more). * * The delay is implemented as active delay loop. * * @param usec Number of microseconds to sleep. */

Source from the content-addressed store, hash-verified

49 * @param usec Number of microseconds to sleep.
50 */
51void delay(uint32_t usec)
52{
53 /*
54 * The delay loop is calibrated for each and every CPU in the system.
55 * If running in a thread context, it is therefore necessary to disable
56 * thread migration. We want to do this in a lightweight manner.
57 */
58 if (THREAD)
59 thread_migration_disable();
60 asm_delay_loop(usec * CPU->delay_loop_const);
61 if (THREAD)
62 thread_migration_enable();
63}
64
65/** @}
66 */

Callers 10

cross_callFunction · 0.85
l_apic_send_init_ipiFunction · 0.85
l_apic_initFunction · 0.85
l_apic_send_init_ipiFunction · 0.85
l_apic_initFunction · 0.85
sys_thread_udelayFunction · 0.85
i8042_clear_bufferFunction · 0.85
i8042_send_commandFunction · 0.85

Calls 3

thread_migration_disableFunction · 0.85
thread_migration_enableFunction · 0.85
asm_delay_loopFunction · 0.50

Tested by

no test coverage detected