diff options
author | Marvin Borner | 2021-04-17 13:55:51 +0200 |
---|---|---|
committer | Marvin Borner | 2021-04-17 13:55:51 +0200 |
commit | 89b5b9acf6037fc1a87f9e85c64831187a47ba94 (patch) | |
tree | 54b2cdc2dbedfb8594a2d89730805467602f7d93 /kernel/drivers | |
parent | 7485f7e441ca892876d9401380aa77610eb85f76 (diff) |
Implemented I/O polling
Diffstat (limited to 'kernel/drivers')
-rw-r--r-- | kernel/drivers/fb.c | 2 | ||||
-rw-r--r-- | kernel/drivers/ps2/keyboard.c | 2 | ||||
-rw-r--r-- | kernel/drivers/ps2/mouse.c | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/kernel/drivers/fb.c b/kernel/drivers/fb.c index c74bc28..dcccf72 100644 --- a/kernel/drivers/fb.c +++ b/kernel/drivers/fb.c @@ -34,7 +34,7 @@ static res fb_ioctl(u32 request, void *arg1, void *arg2, void *arg3) if (!info) return -ENOENT; - if (!arg1 || !memory_writable(arg1)) + if (!memory_writable(arg1)) return -EFAULT; if (fb_owner != 0 && proc_from_pid(fb_owner)) diff --git a/kernel/drivers/ps2/keyboard.c b/kernel/drivers/ps2/keyboard.c index 616c539..be057d7 100644 --- a/kernel/drivers/ps2/keyboard.c +++ b/kernel/drivers/ps2/keyboard.c @@ -60,7 +60,7 @@ static res keyboard_read(void *buf, u32 offset, u32 count) static res keyboard_ready(void) { - return !stack_empty(queue); + return !stack_empty(queue) ? EOK : -EAGAIN; } CLEAR void ps2_keyboard_reset(void) diff --git a/kernel/drivers/ps2/mouse.c b/kernel/drivers/ps2/mouse.c index 1d3c1ae..ba6d338 100644 --- a/kernel/drivers/ps2/mouse.c +++ b/kernel/drivers/ps2/mouse.c @@ -45,6 +45,7 @@ static void mouse_handler(struct regs *r) event->but3 = (mouse_byte[0] >> 2) & 1; stack_push_bot(queue, event); mouse_cycle = 0; + io_unblock(IO_MOUSE); break; default: break; @@ -53,7 +54,7 @@ static void mouse_handler(struct regs *r) static res mouse_ready(void) { - return !stack_empty(queue); + return !stack_empty(queue) ? EOK : -EAGAIN; } static res mouse_read(void *buf, u32 offset, u32 count) |