[console] Add concept of generic console configuration

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2013-11-27 19:42:23 +00:00
parent b2251743d8
commit c501c980e0
5 changed files with 61 additions and 0 deletions

View File

@@ -77,6 +77,13 @@ struct console_driver {
* will not block.
*/
int ( * iskey ) ( void );
/**
* Configure console
*
* @v config Console configuration, or NULL to reset
* @ret rc Return status code
*/
int ( * configure ) ( struct console_configuration *config );
/**
* Console usage bitmask
*
@@ -170,5 +177,15 @@ console_set_usage ( int usage ) {
extern int iskey ( void );
extern int getkey ( unsigned long timeout );
extern int console_configure ( struct console_configuration *config );
/**
* Reset console
*
*/
static inline __attribute__ (( always_inline )) void console_reset ( void ) {
console_configure ( NULL );
}
#endif /* _IPXE_CONSOLE_H */