aboutsummaryrefslogtreecommitdiff
path: root/include/sbi/sbi_console.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sbi/sbi_console.h')
-rw-r--r--include/sbi/sbi_console.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/sbi/sbi_console.h b/include/sbi/sbi_console.h
index 7d648f0..e24ba5f 100644
--- a/include/sbi/sbi_console.h
+++ b/include/sbi/sbi_console.h
@@ -12,6 +12,17 @@
#include <sbi/sbi_types.h>
+struct sbi_console_device {
+ /** Name of the console device */
+ char name[32];
+
+ /** Write a character to the console output */
+ void (*console_putc)(char ch);
+
+ /** Read a character from the console input */
+ int (*console_getc)(void);
+};
+
#define __printf(a, b) __attribute__((format(printf, a, b)))
bool sbi_isprintable(char ch);
@@ -32,6 +43,10 @@ int __printf(1, 2) sbi_printf(const char *format, ...);
int __printf(1, 2) sbi_dprintf(const char *format, ...);
+const struct sbi_console_device *sbi_console_get_device(void);
+
+void sbi_console_set_device(const struct sbi_console_device *dev);
+
struct sbi_scratch;
int sbi_console_init(struct sbi_scratch *scratch);