summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-05-14 00:17:03 -0400
committerIan Moffett <ian@osmora.org>2024-05-14 00:17:03 -0400
commit3980f6c5b6a637a290939ed53f00894d3aaa97b1 (patch)
treec08f9f011439ee30bf9b1113cc0b4efa9c8cd44c /sys/include
parent49da408ed8c3d9903a67e0af113b38283862cb47 (diff)
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 <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/tty.h4
1 files changed, 4 insertions, 0 deletions
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 <sys/types.h>
#include <sys/termios.h>
#include <sys/spinlock.h>
+#include <sys/device.h>
#include <dev/vcons/vcons.h>
#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);