From 881be872675e4cff153c27c641980451c4a3f479 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sun, 14 Jul 2024 19:40:31 +0200 Subject: kernel: make the adhoc VfsQueue queues use ReqQueue instead I'm still not sure if I should use sys/queue.h for this. But yeah, this is more consistent, and it will also let me switch over to O(1) insertions later on. --- src/kernel/arch/amd64/driver/ps2.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/kernel/arch/amd64/driver/ps2.c') diff --git a/src/kernel/arch/amd64/driver/ps2.c b/src/kernel/arch/amd64/driver/ps2.c index 86fcffd..0713293 100644 --- a/src/kernel/arch/amd64/driver/ps2.c +++ b/src/kernel/arch/amd64/driver/ps2.c @@ -58,8 +58,8 @@ void ps2_init(void) { irq_fn[IRQ_PS2KB] = ps2_irq; irq_fn[IRQ_PS2MOUSE] = ps2_irq; - postqueue_init(&kb_queue); - postqueue_init(&mouse_queue); + reqqueue_init(&kb_queue); + reqqueue_init(&mouse_queue); vfs_root_register("/dev/ps2/", accept); } @@ -70,10 +70,10 @@ static void ps2_irq(void) { if (!(status & 1)) break; /* read while data available */ if (status & (1 << 5)) { ring_put1b((void*)&mouse_backlog, port_in8(PS2)); - postqueue_ringreadall(&mouse_queue, (void*)&mouse_backlog); + reqqueue_ringreadall(&mouse_queue, (void*)&mouse_backlog); } else { ring_put1b((void*)&kb_backlog, port_in8(PS2)); - postqueue_ringreadall(&kb_queue, (void*)&kb_backlog); + reqqueue_ringreadall(&kb_queue, (void*)&kb_backlog); } } } @@ -101,11 +101,11 @@ static void accept(VfsReq *req) { ret = req_readcopy(req, data, sizeof data); vfsreq_finish_short(req, ret); } else if ((long __force)req->id == H_KB) { - postqueue_join(&kb_queue, req); - postqueue_ringreadall(&kb_queue, (void*)&kb_backlog); + reqqueue_join(&kb_queue, req); + reqqueue_ringreadall(&kb_queue, (void*)&kb_backlog); } else if ((long __force)req->id == H_MOUSE) { - postqueue_join(&mouse_queue, req); - postqueue_ringreadall(&mouse_queue, (void*)&mouse_backlog); + reqqueue_join(&mouse_queue, req); + reqqueue_ringreadall(&mouse_queue, (void*)&mouse_backlog); } else panic_invalid_state(); break; default: -- cgit v1.2.3