From 3980f6c5b6a637a290939ed53f00894d3aaa97b1 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 14 May 2024 00:17:03 -0400 Subject: kernel: tty: Add tty_attach() This commit adds a new routine called tty_attach(). This routine allows a TTY to be registered with the system and have a device file associated with it. Signed-off-by: Ian Moffett --- sys/include/sys/tty.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/include') diff --git a/sys/include/sys/tty.h b/sys/include/sys/tty.h index 2700abc..4a2c9ec 100644 --- a/sys/include/sys/tty.h +++ b/sys/include/sys/tty.h @@ -33,6 +33,7 @@ #include #include #include +#include #include #define TTY_RING_SIZE 32 @@ -44,14 +45,17 @@ struct tty_ring { }; struct tty { + dev_t id; struct vcons_screen *scr; /* Console screen */ struct tty_ring ring; /* Input ring */ struct spinlock rlock; /* Ring lock */ struct termios termios; /* Termios structure */ + struct device *dev; /* Device pointer */ }; extern struct tty g_root_tty; +dev_t tty_attach(struct tty *tty); int tty_putc(struct tty *tty, int c); ssize_t tty_flush(struct tty *tty); -- cgit v1.2.3