summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe
diff options
context:
space:
mode:
authorMichael Brown2013-12-06 18:47:54 +0100
committerMichael Brown2013-12-06 18:47:54 +0100
commit03401f9d2101b5033c67f6d588152c28a1cc7503 (patch)
treea0885779addd3444b2c5365f04e6a1a95431dd6f /src/include/ipxe
parent[build] Fix LABEL name for .liso images (diff)
downloadipxe-03401f9d2101b5033c67f6d588152c28a1cc7503.tar.gz
ipxe-03401f9d2101b5033c67f6d588152c28a1cc7503.tar.xz
ipxe-03401f9d2101b5033c67f6d588152c28a1cc7503.zip
[console] Allow consoles to update the recorded console size
Provide a mechanism for consoles to update the recorded console width and height, and use this width and height to provide the curses COLS and LINES variables. We choose not to use ANSI escape sequences to obtain the width and height, for two reasons: - iPXE's model is that all output is sent to all consoles; we could therefore end up with multiple consoles reporting conflicting widths and heights - when a serial console is in use, we probably don't want to resize the output shown on the BIOS console to match the size of the serial console, since it's likely that the serial console is in use only for debugging. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe')
-rw-r--r--src/include/ipxe/console.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/include/ipxe/console.h b/src/include/ipxe/console.h
index 9c2620bc..ab39cbfc 100644
--- a/src/include/ipxe/console.h
+++ b/src/include/ipxe/console.h
@@ -159,7 +159,15 @@ struct console_driver {
*/
#define CONSOLE_EXPLICIT( console ) ( ( 2 * console + 1 ) != 2 )
+/** Default console width */
+#define CONSOLE_DEFAULT_WIDTH 80
+
+/** Default console height */
+#define CONSOLE_DEFAULT_HEIGHT 25
+
extern int console_usage;
+extern unsigned int console_width;
+extern unsigned int console_height;
/**
* Set console usage
@@ -175,6 +183,18 @@ console_set_usage ( int usage ) {
return old_usage;
}
+/**
+ * Set console size
+ *
+ * @v width Width, in characters
+ * @v height Height, in characters
+ */
+static inline __attribute__ (( always_inline )) void
+console_set_size ( unsigned int width, unsigned int height ) {
+ console_width = width;
+ console_height = height;
+}
+
extern int iskey ( void );
extern int getkey ( unsigned long timeout );
extern int console_configure ( struct console_configuration *config );