diff options
Diffstat (limited to 'c/src/lib/libbsp/i386/pc386/console/console_select.c')
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/console/console_select.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/console/console_select.c b/c/src/lib/libbsp/i386/pc386/console/console_select.c index c78b4b89bf..1d938a1ebd 100644 --- a/c/src/lib/libbsp/i386/pc386/console/console_select.c +++ b/c/src/lib/libbsp/i386/pc386/console/console_select.c @@ -32,6 +32,22 @@ #endif /* + * Forward prototype + */ +extern bool pc386_com1_com4_enabled(int); + +/* + * This method is used to determine if COM1-COM4 are enabled based upon + * boot command line arguments. + */ +static bool are_com1_com4_enabled; + +bool pc386_com1_com4_enabled(int minor) +{ + return are_com1_com4_enabled; +} + +/* * Method to return true if the device associated with the * minor number probs available. */ @@ -103,6 +119,22 @@ static bool bsp_find_console_entry( return false; } +static void parse_com1_com4_enable(void) +{ + static const char *opt; + + /* + * Check the command line to see if com1-com4 are disabled. + */ + opt = bsp_cmdline_arg("--disable-com1-com4"); + if ( opt ) { + printk( "Disable COM1-COM4 per boot argument\n" ); + are_com1_com4_enabled = false; + } else { + are_com1_com4_enabled = true; + } +} + static bool parse_printk_or_console( const char *param, rtems_device_minor_number *minor_out @@ -198,6 +230,11 @@ void pc386_parse_console_arguments(void) console_initialize_data(); /* + * Determine if COM1-COM4 were disabled. + */ + parse_com1_com4_enable(); + + /* * Assume that if only --console is specified, that printk() should * follow that selection by default. */ |