Changeset 22bbb9f1 in rtems


Ignore:
Timestamp:
Mar 9, 2016, 6:48:39 PM (4 years ago)
Author:
Joel Sherrill <joel@…>
Branches:
master
Children:
81df701a
Parents:
efbf6c9
git-author:
Joel Sherrill <joel@…> (03/09/16 18:48:39)
git-committer:
Joel Sherrill <joel@…> (03/10/16 16:38:46)
Message:

pc386: Add --disable-com1-com4 boot argument

Location:
c/src/lib/libbsp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/console/conscfg.c

    refbf6c9 r22bbb9f1  
    1 /*
    2  *  This file contains the libchip configuration information
    3  *  to instantiate the libchip driver for the VGA console
    4  *  and serial ports on a PC.
     1/**
     2 * @file
     3 *
     4 * This file contains the libchip configuration information
     5 * to instantiate the libchip driver for the VGA console
     6 * and serial ports on a PC.
    57 */
    68
    79/*
    8  *  COPYRIGHT (c) 1989-2014.
     10 *  COPYRIGHT (c) 1989-2014, 2016.
    911 *  On-Line Applications Research Corporation (OAR).
    1012 *
     
    1315 *  http://www.rtems.org/license/LICENSE.
    1416 */
    15 
    16 #include <unistd.h> /* write */
    1717
    1818#include <bsp.h>
     
    2424#include <bsp/irq.h>
    2525#include <rtems/pci.h>
    26 #include <bsp/rtd316.h>
    2726
    2827#if BSP_ENABLE_VGA
     
    5049  {
    5150    register uint8_t val;
    52  
     51
    5352    inport_byte( (addr + i),val );
    5453    return val;
     
    5958    outport_byte( (addr + i),val );
    6059  }
     60
     61  extern bool pc386_com1_com4_enabled(int);
    6162#endif
    6263
     
    6970  {
    7071    "/dev/vgacons",                        /* sDeviceName */
    71     -1,                                     /* deviceType */
     72    -1,                                    /* deviceType */
    7273    &edison_fns,                           /* pDeviceFns */
    7374    NULL,                                  /* deviceProbe */
     
    113114    SERIAL_NS16550,                        /* deviceType */
    114115    COM_CONSOLE_FUNCTIONS,                 /* pDeviceFns */
    115     NULL,                                  /* deviceProbe, assume it is there */
     116    pc386_com1_com4_enabled,               /* deviceProbe */
    116117    NULL,                                  /* pDeviceFlow */
    117118    16,                                    /* ulMargin */
     
    132133    SERIAL_NS16550,                        /* deviceType */
    133134    COM_CONSOLE_FUNCTIONS,                 /* pDeviceFns */
    134     NULL,                                  /* deviceProbe, assume it is there */
     135    pc386_com1_com4_enabled,               /* deviceProbe */
    135136    NULL,                                  /* pDeviceFlow */
    136137    16,                                    /* ulMargin */
     
    152153    SERIAL_NS16550,                        /* deviceType */
    153154    COM_CONSOLE_FUNCTIONS,                 /* pDeviceFns */
    154     NULL,                                  /* deviceProbe, assume it is there */
     155    pc386_com1_com4_enabled,               /* deviceProbe */
    155156    NULL,                                  /* pDeviceFlow */
    156157    16,                                    /* ulMargin */
     
    172173    SERIAL_NS16550,                        /* deviceType */
    173174    COM_CONSOLE_FUNCTIONS,                 /* pDeviceFns */
    174     NULL,                                  /* deviceProbe, assume it is there */
     175    pc386_com1_com4_enabled,               /* deviceProbe */
    175176    NULL,                                  /* pDeviceFlow */
    176177    16,                                    /* ulMargin */
  • c/src/lib/libbsp/i386/pc386/console/console_select.c

    refbf6c9 r22bbb9f1  
    3131  #include <crt.h>
    3232#endif
     33
     34/*
     35 * Forward prototype
     36 */
     37extern bool pc386_com1_com4_enabled(int);
     38
     39/*
     40 * This method is used to determine if COM1-COM4 are enabled based upon
     41 * boot command line arguments.
     42 */
     43static bool are_com1_com4_enabled;
     44
     45bool pc386_com1_com4_enabled(int minor)
     46{
     47  return are_com1_com4_enabled;
     48}
    3349
    3450/*
     
    102118
    103119  return false;
     120}
     121
     122static void parse_com1_com4_enable(void)
     123{
     124  static const char *opt;
     125
     126  /*
     127   * Check the command line to see if com1-com4 are disabled.
     128   */
     129  opt = bsp_cmdline_arg("--disable-com1-com4");
     130  if ( opt ) {
     131    printk( "Disable COM1-COM4 per boot argument\n" );
     132    are_com1_com4_enabled = false;
     133  } else {
     134    are_com1_com4_enabled = true;
     135  }
    104136}
    105137
     
    199231
    200232  /*
     233   * Determine if COM1-COM4 were disabled.
     234   */
     235  parse_com1_com4_enable();
     236
     237  /*
    201238   * Assume that if only --console is specified, that printk() should
    202239   * follow that selection by default.
  • c/src/lib/libbsp/shared/console.c

    refbf6c9 r22bbb9f1  
    118118  Console_Port_Data = realloc(
    119119    Console_Port_Data,
    120     Console_Port_Count * sizeof(console_tbl *)
     120    Console_Port_Count * sizeof(console_data)
    121121  );
    122122  if ( Console_Port_Data == NULL ) {
    123123    bsp_fatal( BSP_FATAL_CONSOLE_NO_MEMORY_2 );
    124124  }
    125   memset(&Console_Port_Data, '\0', Console_Port_Count * sizeof(console_tbl *));
     125  memset(Console_Port_Data, '\0', Console_Port_Count * sizeof(console_data));
    126126
    127127  /*
Note: See TracChangeset for help on using the changeset viewer.