summaryrefslogtreecommitdiff
path: root/kernel/src/devices/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/devices/timer.c')
-rw-r--r--kernel/src/devices/timer.c5
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) ;