From 0f4b072a47e06f262b160e3a0d34f901bf2a1111 Mon Sep 17 00:00:00 2001 From: Matheus Date: Wed, 14 Oct 2026 23:52:03 -0300 Subject: [PATCH] tty: drop interrupt-safety todo This is better handled as work. --- kernel-src/io/serial/pc_com.c | 1 - kernel-src/io/tty.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/kernel-src/io/serial/pc_com.c b/kernel-src/io/serial/pc_com.c index 886d1493..aa6e76f9 100644 --- a/kernel-src/io/serial/pc_com.c +++ b/kernel-src/io/serial/pc_com.c @@ -183,7 +183,6 @@ static size_t write_tty(void *internal, char *str, size_t size) { return size; } -// TODO enqueue dpc and call tty_process directly from it once it is safe to be called from an interrupt context static void irq(isr_t *self, context_t *) { pc_com_t *pc_com = self->priv; diff --git a/kernel-src/io/tty.c b/kernel-src/io/tty.c index c21e2ca3..16b5b772 100644 --- a/kernel-src/io/tty.c +++ b/kernel-src/io/tty.c @@ -43,14 +43,6 @@ static int setforeground(tty_t *tty, proc_t *proc) { return ENOTTY; } -// TODO: make this interrupt safe -// this would mean: -// - preventing the leaders from reaching refcnt = 1 during the getforeground() call until it is done -// - list mutex -> list spinlock -// -// however, for it to truly be interrupt safe, the tty->writetodevice callback would also need to be interrupt safe, -// which means that any drivers expecting to call this from an interrupt context would REQUIRE to have the callback to also be interrupt safe -// the main console is an example of a driver which would not be able to do so. void tty_process(tty_t *tty, char c) { if (c == '\r' && (tty->termios.c_iflag & IGNCR)) return;