diff options
| author | Aleksa Vuckovic <aleksa@vuckovic.cc> | 2023-02-22 18:48:51 +0100 |
|---|---|---|
| committer | Aleksa Vuckovic <aleksa@vuckovic.cc> | 2023-02-22 18:48:51 +0100 |
| commit | caba4178bbfd7b3b1ff2e156e24b08015137d16a (patch) | |
| tree | 46205b3e9d2a881c3c17297068528e7ee858f989 /kernel/src/devices/timer.c | |
| parent | 53069ae43ea997d51d2b985a26fffdb86a59b023 (diff) | |
ANSI C: volatile -> __volatile__
Diffstat (limited to 'kernel/src/devices/timer.c')
| -rw-r--r-- | kernel/src/devices/timer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/src/devices/timer.c b/kernel/src/devices/timer.c index 09ed21c..c2fa887 100644 --- a/kernel/src/devices/timer.c +++ b/kernel/src/devices/timer.c @@ -3,6 +3,7 @@ #include <heap.h> #include <libk/list.h> #include <io.h> +#include <idt.h> uint32_t tick = 0; uint32_t seconds = 0; @@ -31,11 +32,11 @@ void timer_handler() void wait(uint64_t ms) { - __asm__ volatile ("cli;"); + disable_interrupts(); wait_queue* queue = (wait_queue*)kalloc(sizeof(wait_queue)); queue->ticks = (int64_t)ms; add_to_list(&queue->list, &timer_queue.list, timer_queue.list.next); - __asm__ volatile ("sti;"); + enable_interrupts(); while (queue->ticks > 0) ; |
