[console] Allow usage to be defined independently for each console
Add the concept of a "console usage", such as "standard output" or "debug messages". Allow usages to be associated with each console independently. For example, to send debugging output via the serial port, while preventing it from appearing on the local console: #define CONSOLE_SERIAL CONSOLE_USAGE_ALL #define CONSOLE_PCBIOS ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_DEBUG ) If no usages are explicitly specified, then a default set of usages will be applied. For example: #define CONSOLE_SERIAL will have the same affect as #define CONSOLE_SERIAL CONSOLE_USAGE_ALL Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -29,10 +29,17 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
||||
#include <ipxe/lineconsole.h>
|
||||
#include <ipxe/init.h>
|
||||
#include <ipxe/guestrpc.h>
|
||||
#include <config/console.h>
|
||||
|
||||
/** VMware logfile console buffer size */
|
||||
#define VMCONSOLE_BUFSIZE 128
|
||||
|
||||
/* Set default console usage if applicable */
|
||||
#if ! ( defined ( CONSOLE_VMWARE ) && CONSOLE_EXPLICIT ( CONSOLE_VMWARE ) )
|
||||
#undef CONSOLE_VMWARE
|
||||
#define CONSOLE_VMWARE CONSOLE_USAGE_ALL
|
||||
#endif
|
||||
|
||||
/** VMware logfile console GuestRPC channel */
|
||||
static int vmconsole_channel;
|
||||
|
||||
@@ -87,6 +94,7 @@ static void vmconsole_putchar ( int character ) {
|
||||
struct console_driver vmconsole __console_driver = {
|
||||
.putchar = vmconsole_putchar,
|
||||
.disabled = 1,
|
||||
.usage = CONSOLE_VMWARE,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user