feat: added support for waiting on an irq

This commit is contained in:
2021-02-27 15:52:10 +01:00
parent 934deb7984
commit 62ce1dfa77
8 changed files with 126 additions and 22 deletions

View File

@@ -8,6 +8,7 @@
#include <libc/ringqueue.h>
#include <libk/libk.h>
#include <mem/malloc.h>
#include <libk/syscall.h>
const char scancode_map_lowercase[] = {
@@ -63,7 +64,8 @@ char getc() {
KeyEvent *get_next_event() {
KeyEvent *target = malloc(sizeof(KeyEvent));
if (!ring_buffer_get(keyboard_event_buffer, target)) {
k_wait_for_interrupt();
syscall_yield_irq(1 << 1);
// k_wait_for_interrupt();
free(target);
return NULL;
}