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/rtl8139.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/kernel/arch/amd64/driver/rtl8139.c') diff --git a/src/kernel/arch/amd64/driver/rtl8139.c b/src/kernel/arch/amd64/driver/rtl8139.c index bce1071..c952d8a 100644 --- a/src/kernel/arch/amd64/driver/rtl8139.c +++ b/src/kernel/arch/amd64/driver/rtl8139.c @@ -86,7 +86,7 @@ void rtl8139_init(uint32_t bdf) { mac[i] = port_in8(iobase + Mac + i); } - postqueue_init(&blocked_on); + reqqueue_init(&blocked_on); vfs_root_register("/dev/eth/", accept); } @@ -102,7 +102,7 @@ static void rtl8139_irq(void) { /* bit 0 of cmd - Rx Buffer Empty * not a do while() because sometimes the bit is empty on IRQ. no clue why. */ while (!(port_in8(iobase + Cmd) & 1)) { - VfsReq *req = postqueue_pop(&blocked_on); + VfsReq *req = reqqueue_pop(&blocked_on); if (req) { accept(req); } else { @@ -206,7 +206,7 @@ static void accept(VfsReq *req) { } else if (id == HandleNet) { ret = try_rx(req->caller, req->output.buf, req->output.len); if (ret == WAIT) { - postqueue_join(&blocked_on, req); + reqqueue_join(&blocked_on, req); rx_irq_enable(true); } else { vfsreq_finish_short(req, ret); -- cgit v1.2.3