From 1c0ff6e1a720907f9211f43d4d8d9fc18d522348 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 9 Mar 2011 20:09:26 +0000 Subject: [console] Move include/console.h to include/ipxe/console.h Signed-off-by: Michael Brown --- src/arch/i386/core/video_subr.c | 2 +- src/arch/i386/firmware/pcbios/bios_console.c | 2 +- src/arch/i386/interface/syslinux/comboot_call.c | 2 +- src/core/btext.c | 2 +- src/core/console.c | 2 +- src/core/debug.c | 2 +- src/core/getkey.c | 2 +- src/core/monojob.c | 2 +- src/core/pc_kbd.c | 2 +- src/core/pcmcia.c | 2 +- src/core/serial_console.c | 2 +- src/core/vsprintf.c | 2 +- src/drivers/net/3c509-eisa.c | 2 +- src/drivers/net/cs89x0.c | 2 +- src/drivers/net/depca.c | 2 +- src/drivers/net/epic100.c | 2 +- src/drivers/net/etherfabric.c | 2 +- src/hci/mucurses/ansi_screen.c | 2 +- src/hci/mucurses/mucurses.c | 2 +- src/hci/readline.c | 2 +- src/hci/tui/login_ui.c | 2 +- src/hci/tui/settings_ui.c | 2 +- src/include/console.h | 108 ------------------------ src/include/etherboot.h | 2 +- src/include/ipxe/console.h | 108 ++++++++++++++++++++++++ src/interface/efi/efi_console.c | 2 +- src/interface/linux/linux_console.c | 2 +- src/usr/ifmgmt.c | 2 +- src/usr/iwmgmt.c | 2 +- src/usr/lotest.c | 2 +- src/usr/prompt.c | 2 +- src/usr/pxemenu.c | 2 +- 32 files changed, 138 insertions(+), 138 deletions(-) delete mode 100644 src/include/console.h create mode 100644 src/include/ipxe/console.h (limited to 'src') diff --git a/src/arch/i386/core/video_subr.c b/src/arch/i386/core/video_subr.c index 4c583e5b6..6885ad9af 100644 --- a/src/arch/i386/core/video_subr.c +++ b/src/arch/i386/core/video_subr.c @@ -8,7 +8,7 @@ #include "stddef.h" #include "string.h" #include -#include "console.h" +#include #include #include "vga.h" diff --git a/src/arch/i386/firmware/pcbios/bios_console.c b/src/arch/i386/firmware/pcbios/bios_console.c index 0743fd237..0720cd76d 100644 --- a/src/arch/i386/firmware/pcbios/bios_console.c +++ b/src/arch/i386/firmware/pcbios/bios_console.c @@ -20,7 +20,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include -#include +#include #include #define ATTR_BOLD 0x08 diff --git a/src/arch/i386/interface/syslinux/comboot_call.c b/src/arch/i386/interface/syslinux/comboot_call.c index 221b597d4..571ba9e6d 100644 --- a/src/arch/i386/interface/syslinux/comboot_call.c +++ b/src/arch/i386/interface/syslinux/comboot_call.c @@ -26,7 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include -#include +#include #include #include #include diff --git a/src/core/btext.c b/src/core/btext.c index 994ebbf67..4fb7378d9 100644 --- a/src/core/btext.c +++ b/src/core/btext.c @@ -9,7 +9,7 @@ * move to Etherboot by LYH */ -#include "console.h" +#include #include #include diff --git a/src/core/console.c b/src/core/console.c index 1d2aa5e57..f27edf468 100644 --- a/src/core/console.c +++ b/src/core/console.c @@ -1,5 +1,5 @@ #include "stddef.h" -#include "console.h" +#include #include #include diff --git a/src/core/debug.c b/src/core/debug.c index 842199202..73e74d9c3 100644 --- a/src/core/debug.c +++ b/src/core/debug.c @@ -22,7 +22,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include -#include +#include /** * Pause until a key is pressed diff --git a/src/core/getkey.c b/src/core/getkey.c index b8e6af786..d692b1bc8 100644 --- a/src/core/getkey.c +++ b/src/core/getkey.c @@ -19,7 +19,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include -#include +#include #include #include #include diff --git a/src/core/monojob.c b/src/core/monojob.c index 682b1dfbe..62e672a4c 100644 --- a/src/core/monojob.c +++ b/src/core/monojob.c @@ -22,7 +22,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include -#include +#include #include #include #include diff --git a/src/core/pc_kbd.c b/src/core/pc_kbd.c index 8c07a7f01..42df755b5 100644 --- a/src/core/pc_kbd.c +++ b/src/core/pc_kbd.c @@ -11,7 +11,7 @@ */ #include -#include "console.h" +#include static char key_map[][128] = { { diff --git a/src/core/pcmcia.c b/src/core/pcmcia.c index f39cd04fe..2d8ceb6f5 100644 --- a/src/core/pcmcia.c +++ b/src/core/pcmcia.c @@ -34,7 +34,7 @@ FILE_LICENCE ( GPL2_ONLY ); #define CODE_STATUS "alpha" #define CODE_VERSION "0.1.3" #include -#include +#include #include int sockets; /* AHTODO: Phase this out! */ diff --git a/src/core/serial_console.c b/src/core/serial_console.c index 70cf2657e..b05a06b17 100644 --- a/src/core/serial_console.c +++ b/src/core/serial_console.c @@ -1,6 +1,6 @@ #include #include -#include "console.h" +#include /** @file * diff --git a/src/core/vsprintf.c b/src/core/vsprintf.c index 3ed4bd3da..b46d9c419 100644 --- a/src/core/vsprintf.c +++ b/src/core/vsprintf.c @@ -21,7 +21,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include -#include +#include #include #include diff --git a/src/drivers/net/3c509-eisa.c b/src/drivers/net/3c509-eisa.c index bb13f48c8..195a844a4 100644 --- a/src/drivers/net/3c509-eisa.c +++ b/src/drivers/net/3c509-eisa.c @@ -6,7 +6,7 @@ #include #include -#include "console.h" +#include #include "3c509.h" /* diff --git a/src/drivers/net/cs89x0.c b/src/drivers/net/cs89x0.c index 448ff5181..ee34d0c59 100644 --- a/src/drivers/net/cs89x0.c +++ b/src/drivers/net/cs89x0.c @@ -92,7 +92,7 @@ FILE_LICENCE ( GPL2_ONLY ); #include "etherboot.h" #include "nic.h" #include -#include "console.h" +#include #include "cs89x0.h" static unsigned short eth_nic_base; diff --git a/src/drivers/net/depca.c b/src/drivers/net/depca.c index 6be3e1041..735a52dfb 100644 --- a/src/drivers/net/depca.c +++ b/src/drivers/net/depca.c @@ -240,7 +240,7 @@ FILE_LICENCE ( GPL_ANY ); #include "etherboot.h" #include "nic.h" #include -#include "console.h" +#include #include /* diff --git a/src/drivers/net/epic100.c b/src/drivers/net/epic100.c index c8b6a6cdf..9105a97be 100644 --- a/src/drivers/net/epic100.c +++ b/src/drivers/net/epic100.c @@ -10,7 +10,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include "nic.h" -#include "console.h" +#include #include "epic100.h" /* Condensed operations for readability */ diff --git a/src/drivers/net/etherfabric.c b/src/drivers/net/etherfabric.c index f7aae14f8..1073bf7f9 100644 --- a/src/drivers/net/etherfabric.c +++ b/src/drivers/net/etherfabric.c @@ -24,7 +24,7 @@ FILE_LICENCE ( GPL_ANY ); #include #include #include -#include +#include #include #include #include diff --git a/src/hci/mucurses/ansi_screen.c b/src/hci/mucurses/ansi_screen.c index 51fc7c904..cc342f7ca 100644 --- a/src/hci/mucurses/ansi_screen.c +++ b/src/hci/mucurses/ansi_screen.c @@ -1,6 +1,6 @@ #include #include -#include +#include FILE_LICENCE ( GPL2_OR_LATER ); diff --git a/src/hci/mucurses/mucurses.c b/src/hci/mucurses/mucurses.c index 087ebcc34..7c1620210 100644 --- a/src/hci/mucurses/mucurses.c +++ b/src/hci/mucurses/mucurses.c @@ -1,4 +1,4 @@ -#include +#include #include #include "mucurses.h" diff --git a/src/hci/readline.c b/src/hci/readline.c index 6a7af9db6..e76d2d09a 100644 --- a/src/hci/readline.c +++ b/src/hci/readline.c @@ -21,7 +21,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include -#include +#include #include #include #include diff --git a/src/hci/tui/login_ui.c b/src/hci/tui/login_ui.c index 954bde509..04aabfa8c 100644 --- a/src/hci/tui/login_ui.c +++ b/src/hci/tui/login_ui.c @@ -27,7 +27,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include -#include +#include #include #include #include diff --git a/src/hci/tui/settings_ui.c b/src/hci/tui/settings_ui.c index 176fbd3ed..ff2f9af11 100644 --- a/src/hci/tui/settings_ui.c +++ b/src/hci/tui/settings_ui.c @@ -23,7 +23,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include -#include +#include #include #include #include diff --git a/src/include/console.h b/src/include/console.h deleted file mode 100644 index df9e8092f..000000000 --- a/src/include/console.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef CONSOLE_H -#define CONSOLE_H - -#include - -/** @file - * - * User interaction. - * - * Various console devices can be selected via the build options - * CONSOLE_FIRMWARE, CONSOLE_SERIAL etc. The console functions - * putchar(), getchar() and iskey() delegate to the individual console - * drivers. - * - */ - -FILE_LICENCE ( GPL2_OR_LATER ); - -/** - * A console driver - * - * Defines the functions that implement a particular console type. - * Must be made part of the console drivers table by using - * #__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. - * - */ -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. - * - */ - int disabled; - - /** 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. - * - * @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. - * - * @v None - - * @ret True Input is available - * @ret False Input is not available - * @err None - - * - * This should return True if a subsequent call to getchar() - * will not block. - * - */ - int ( *iskey ) ( void ); -}; - -/** Console driver table */ -#define CONSOLES __table ( struct console_driver, "consoles" ) - -/** - * Mark a struct console_driver as being part of the - * console drivers table. - * - * Use as e.g. - * - * @code - * - * struct console_driver my_console __console_driver = { - * .putchar = my_putchar, - * .getchar = my_getchar, - * .iskey = my_iskey, - * }; - * - * @endcode - * - */ -#define __console_driver __table_entry ( CONSOLES, 01 ) - -/* Function prototypes */ - -extern void putchar ( int character ); -extern int getchar ( void ); -extern int iskey ( void ); -extern int getkey ( unsigned long timeout ); - -#endif /* CONSOLE_H */ diff --git a/src/include/etherboot.h b/src/include/etherboot.h index 3241294d9..b2fbe4f67 100644 --- a/src/include/etherboot.h +++ b/src/include/etherboot.h @@ -14,7 +14,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include -#include +#include #include #include #include diff --git a/src/include/ipxe/console.h b/src/include/ipxe/console.h new file mode 100644 index 000000000..3bfa5033f --- /dev/null +++ b/src/include/ipxe/console.h @@ -0,0 +1,108 @@ +#ifndef _IPXE_CONSOLE_H +#define _IPXE_CONSOLE_H + +#include + +/** @file + * + * User interaction. + * + * Various console devices can be selected via the build options + * CONSOLE_FIRMWARE, CONSOLE_SERIAL etc. The console functions + * putchar(), getchar() and iskey() delegate to the individual console + * drivers. + * + */ + +FILE_LICENCE ( GPL2_OR_LATER ); + +/** + * A console driver + * + * Defines the functions that implement a particular console type. + * Must be made part of the console drivers table by using + * #__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. + * + */ +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. + * + */ + int disabled; + + /** 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. + * + * @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. + * + * @v None - + * @ret True Input is available + * @ret False Input is not available + * @err None - + * + * This should return True if a subsequent call to getchar() + * will not block. + * + */ + int ( *iskey ) ( void ); +}; + +/** Console driver table */ +#define CONSOLES __table ( struct console_driver, "consoles" ) + +/** + * Mark a struct console_driver as being part of the + * console drivers table. + * + * Use as e.g. + * + * @code + * + * struct console_driver my_console __console_driver = { + * .putchar = my_putchar, + * .getchar = my_getchar, + * .iskey = my_iskey, + * }; + * + * @endcode + * + */ +#define __console_driver __table_entry ( CONSOLES, 01 ) + +/* Function prototypes */ + +extern void putchar ( int character ); +extern int getchar ( void ); +extern int iskey ( void ); +extern int getkey ( unsigned long timeout ); + +#endif /* _IPXE_CONSOLE_H */ diff --git a/src/interface/efi/efi_console.c b/src/interface/efi/efi_console.c index 6d766ece8..1303a4278 100644 --- a/src/interface/efi/efi_console.c +++ b/src/interface/efi/efi_console.c @@ -22,7 +22,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include -#include +#include #define ATTR_BOLD 0x08 diff --git a/src/interface/linux/linux_console.c b/src/interface/linux/linux_console.c index 0fdb8f2f9..aeb7c6618 100644 --- a/src/interface/linux/linux_console.c +++ b/src/interface/linux/linux_console.c @@ -24,7 +24,7 @@ FILE_LICENCE(GPL2_OR_LATER); * */ -#include +#include #include #include diff --git a/src/usr/ifmgmt.c b/src/usr/ifmgmt.c index e031cd09e..e9fdaad0d 100644 --- a/src/usr/ifmgmt.c +++ b/src/usr/ifmgmt.c @@ -22,7 +22,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include -#include +#include #include #include #include diff --git a/src/usr/iwmgmt.c b/src/usr/iwmgmt.c index db0d1b449..29f623c37 100644 --- a/src/usr/iwmgmt.c +++ b/src/usr/iwmgmt.c @@ -19,7 +19,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include -#include +#include #include #include #include diff --git a/src/usr/lotest.c b/src/usr/lotest.c index c8ee62134..7f9f2fd07 100644 --- a/src/usr/lotest.c +++ b/src/usr/lotest.c @@ -28,7 +28,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include -#include +#include #include #include diff --git a/src/usr/prompt.c b/src/usr/prompt.c index 7f9a94484..3c353a686 100644 --- a/src/usr/prompt.c +++ b/src/usr/prompt.c @@ -26,7 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include -#include +#include #include #include diff --git a/src/usr/pxemenu.c b/src/usr/pxemenu.c index b31051629..75789e2dc 100644 --- a/src/usr/pxemenu.c +++ b/src/usr/pxemenu.c @@ -26,7 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include -#include +#include #include #include #include -- cgit v1.2.3-55-g7522