diff options
author | Joel Sherrill <joel@rtems.org> | 2016-03-09 12:48:39 -0600 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2016-03-10 10:38:46 -0600 |
commit | 22bbb9f16589322fb979bacc79f50b02ef34f57a (patch) | |
tree | 12110f83d5d2d26507607e80597909ce2d939742 /c/src/lib/libbsp/i386/pc386/console/console_select.c | |
parent | libbsp/shared/console.c: Clean up memory allocation for per device data (diff) | |
download | rtems-22bbb9f16589322fb979bacc79f50b02ef34f57a.tar.bz2 |
pc386: Add --disable-com1-com4 boot argument
Diffstat (limited to '')
-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. */ |