summaryrefslogtreecommitdiffstats
path: root/src/include/console.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/console.h')
-rw-r--r--src/include/console.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/include/console.h b/src/include/console.h
new file mode 100644
index 00000000..ce2e5392
--- /dev/null
+++ b/src/include/console.h
@@ -0,0 +1,28 @@
+#ifndef CONSOLE_H
+#define CONSOLE_H
+
+#include "stdint.h"
+
+/*
+ * Consoles that cannot be used before their INIT_FN() has completed
+ * should set disabled = 1 initially. This allows other console
+ * devices to still be used to print out early debugging messages.
+ */
+
+struct console_driver {
+ int disabled;
+ void ( *putchar ) ( int character );
+ int ( *getchar ) ( void );
+ int ( *iskey ) ( void );
+};
+
+#define __console_driver \
+ __attribute__ (( used, __section__ ( ".drivers.console" ) ))
+
+/* Function prototypes */
+
+extern void putchar ( int character );
+extern int getchar ( void );
+extern int iskey ( void );
+
+#endif /* CONSOLE_H */