aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-19 21:31:38 -0400
committerIan Moffett <ian@osmora.org>2024-03-19 21:31:38 -0400
commitd1bafb75630db5cc07825e53f28a241c2005b43b (patch)
tree41c8d691434d28cd3672a403169c1adf1e64fc8b
parentf985907ae497b836b53d932232e3cf6daac9c678 (diff)
kernel: vcons: Add vcons_putstr() routine
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--sys/dev/vcons/vcons.c19
-rw-r--r--sys/include/dev/vcons/vcons.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/sys/dev/vcons/vcons.c b/sys/dev/vcons/vcons.c
index 91ea906..cba0b85 100644
--- a/sys/dev/vcons/vcons.c
+++ b/sys/dev/vcons/vcons.c
@@ -197,6 +197,25 @@ vcons_putch(struct vcons_screen *scr, char c)
return 0;
}
+/*
+ * Write out a string on the console.
+ *
+ * @s: String to write.
+ */
+int
+vcons_putstr(struct vcons_screen *scr, const char *s)
+{
+ int status;
+
+ while (*s != '\0') {
+ if ((status = vcons_putch(scr, *(s++))) != 0) {
+ return status;
+ }
+ }
+
+ return 0;
+}
+
void
vcons_attach(struct vcons_screen *scr)
{
diff --git a/sys/include/dev/vcons/vcons.h b/sys/include/dev/vcons/vcons.h
index 737651f..9deb656 100644
--- a/sys/include/dev/vcons/vcons.h
+++ b/sys/include/dev/vcons/vcons.h
@@ -67,6 +67,7 @@ struct vcons_screen {
void vcons_attach(struct vcons_screen *scr);
int vcons_putch(struct vcons_screen *scr, char c);
+int vcons_putstr(struct vcons_screen *scr, const char *s);
void vcons_update_cursor(struct vcons_screen *scr);
#endif /* !_DEV_VCONS_H_ */