aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-19 22:59:13 -0400
committerIan Moffett <ian@osmora.org>2024-03-19 22:59:13 -0400
commited34392443c411214e6e91c3f912185115a39175 (patch)
treea93706c580c2d61a552ae9054c207dc1f3c3a200 /sys
parentd1bafb75630db5cc07825e53f28a241c2005b43b (diff)
kernel: syslog: Make syslog_screen extern
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys')
-rw-r--r--sys/include/sys/syslog.h3
-rw-r--r--sys/kern/kern_syslog.c12
2 files changed, 9 insertions, 6 deletions
diff --git a/sys/include/sys/syslog.h b/sys/include/sys/syslog.h
index 7706eec..3015f6b 100644
--- a/sys/include/sys/syslog.h
+++ b/sys/include/sys/syslog.h
@@ -35,6 +35,7 @@
#define _SYS_SYSLOG_H_
#include <stdarg.h>
+#include <dev/vcons/vcons.h>
#if defined(_KERNEL)
@@ -58,6 +59,8 @@ void syslog_init(void);
void kprintf(const char *fmt, ...);
void vkprintf(const char *fmt, va_list *ap);
+extern struct vcons_screen g_syslog_screen;
+
#endif /* defined(_KERNEL) */
#endif /* !_SYS_SYSLOG_H_ */
diff --git a/sys/kern/kern_syslog.c b/sys/kern/kern_syslog.c
index d8880a9..cdce157 100644
--- a/sys/kern/kern_syslog.c
+++ b/sys/kern/kern_syslog.c
@@ -32,7 +32,7 @@
#include <dev/vcons/vcons.h>
#include <string.h>
-static struct vcons_screen syslog_screen = {0};
+struct vcons_screen g_syslog_screen = {0};
static void
syslog_write(const char *s, size_t len)
@@ -44,7 +44,7 @@ syslog_write(const char *s, size_t len)
#if defined(__SERIAL_DEBUG)
serial_dbgch(*tmp_s);
#endif /* defined(__SERIAL_DEBUG) */
- vcons_putch(&syslog_screen, *tmp_s++);
+ vcons_putch(&g_syslog_screen, *tmp_s++);
}
}
@@ -129,9 +129,9 @@ syslog_init(void)
termios.c_oflag |= OCRNL; /* Map CR to NL by default */
- syslog_screen.bg = 0x000000;
- syslog_screen.fg = 0x808080;
- syslog_screen.termios = termios;
+ g_syslog_screen.bg = 0x000000;
+ g_syslog_screen.fg = 0x808080;
+ g_syslog_screen.termios = termios;
- vcons_attach(&syslog_screen);
+ vcons_attach(&g_syslog_screen);
}