summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/console.h
diff options
context:
space:
mode:
authorMichael Brown2013-11-28 06:41:45 +0100
committerMichael Brown2013-11-28 06:54:53 +0100
commitb2251743d80f94445f40f64b75b63d33fe1d8725 (patch)
tree9c1424242dc2a1a6508bf3e7a723cadf4632f1de /src/include/ipxe/console.h
parent[mucurses] Use "<ESC>[2J" ANSI escape sequence to clear screen (diff)
downloadipxe-b2251743d80f94445f40f64b75b63d33fe1d8725.tar.gz
ipxe-b2251743d80f94445f40f64b75b63d33fe1d8725.tar.xz
ipxe-b2251743d80f94445f40f64b75b63d33fe1d8725.zip
[console] Allow console input and output to be disabled independently
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/console.h')
-rw-r--r--src/include/ipxe/console.h77
1 files changed, 44 insertions, 33 deletions
diff --git a/src/include/ipxe/console.h b/src/include/ipxe/console.h
index e2bf4be9..2fcc4150 100644
--- a/src/include/ipxe/console.h
+++ b/src/include/ipxe/console.h
@@ -1,6 +1,7 @@
#ifndef _IPXE_CONSOLE_H
#define _IPXE_CONSOLE_H
+#include <stddef.h>
#include <stdio.h>
#include <ipxe/tables.h>
@@ -17,6 +18,20 @@
FILE_LICENCE ( GPL2_OR_LATER );
+struct pixel_buffer;
+
+/** A console configuration */
+struct console_configuration {
+ /** Width */
+ unsigned int width;
+ /** Height */
+ unsigned int height;
+ /** Colour depth */
+ unsigned int bpp;
+ /** Background picture, if any */
+ struct pixel_buffer *pixbuf;
+};
+
/**
* A console driver
*
@@ -25,58 +40,45 @@ FILE_LICENCE ( GPL2_OR_LATER );
* #__console_driver.
*
* @note Consoles that cannot be used before their initialisation
- * function has completed should set #disabled=1 initially. This
- * allows other console devices to still be used to print out early
- * debugging messages.
- *
+ * function has completed should set #disabled initially. This allows
+ * other console devices to still be used to print out early debugging
+ * messages.
*/
struct console_driver {
- /** Console is disabled.
- *
- * The console's putchar(), getchar() and iskey() methods will
- * not be called while #disabled==1. Typically the console's
- * initialisation functions will set #disabled=0 upon
- * completion.
+ /**
+ * Console disabled flags
*
+ * This is the bitwise OR of zero or more console disabled
+ * flags.
*/
int disabled;
-
- /** Write a character to the console.
+ /**
+ * Write a character to the console
*
* @v character Character to be written
- * @ret None -
- * @err None -
- *
*/
- void ( *putchar ) ( int character );
-
- /** Read a character from the console.
+ void ( * putchar ) ( int character );
+ /**
+ * Read a character from the console
*
- * @v None -
* @ret character Character read
- * @err None -
*
* If no character is available to be read, this method will
* block. The character read should not be echoed back to the
* console.
- *
*/
- int ( *getchar ) ( void );
-
- /** Check for available input.
+ int ( * getchar ) ( void );
+ /**
+ * Check for available input
*
- * @v None -
- * @ret True Input is available
- * @ret False Input is not available
- * @err None -
+ * @ret is_available Input is available
*
- * This should return True if a subsequent call to getchar()
+ * This should return true if a subsequent call to getchar()
* will not block.
- *
*/
- int ( *iskey ) ( void );
-
- /** Console usage bitmask
+ int ( * iskey ) ( void );
+ /**
+ * Console usage bitmask
*
* This is the bitwise OR of zero or more @c CONSOLE_USAGE_XXX
* values.
@@ -84,6 +86,15 @@ struct console_driver {
int usage;
};
+/** Console is disabled for input */
+#define CONSOLE_DISABLED_INPUT 0x0001
+
+/** Console is disabled for output */
+#define CONSOLE_DISABLED_OUTPUT 0x0002
+
+/** Console is disabled for all uses */
+#define CONSOLE_DISABLED ( CONSOLE_DISABLED_INPUT | CONSOLE_DISABLED_OUTPUT )
+
/** Console driver table */
#define CONSOLES __table ( struct console_driver, "consoles" )