diff --git a/arch/x86/apic.c b/arch/x86/apic.c index bff081da..e50f3beb 100644 --- a/arch/x86/apic.c +++ b/arch/x86/apic.c @@ -188,7 +188,7 @@ void init_apic_timer(void) { apic_write(APIC_LVT_TIMER, timer.reg); /* Sleep for 20ms to calibrate, count the ticks */ - sleep(CAL_SLEEP_TIME); + msleep(CAL_SLEEP_TIME); /* Calibrate */ uint32_t elapsed_ticks = (_U32(-1) - apic_read(APIC_TMR_CCR)) / CAL_SLEEP_TIME; diff --git a/include/time.h b/include/time.h index 6e5bad40..ef8c531b 100644 --- a/include/time.h +++ b/include/time.h @@ -27,13 +27,13 @@ typedef uint64_t time_t; -extern void sleep(time_t ms); +extern void msleep(time_t ms); extern time_t get_timer_ticks(void); /* Static declarations */ -static inline void msleep(time_t ms) { - sleep(ms); +static inline void sleep(time_t s) { + msleep(s * 1000); } #endif diff --git a/lib/time.c b/lib/time.c index f3bbd5ea..26b0bcee 100644 --- a/lib/time.c +++ b/lib/time.c @@ -32,7 +32,7 @@ void timer_interrupt_handler(void) { apic_EOI(); } -void sleep(time_t ms) { +void msleep(time_t ms) { time_t end = ticks + ms; while (ticks < end) { cpu_relax();