mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
2008-05-23 Joel Sherrill <joel.sherrill@OARcorp.com>
* console/console.c: Eliminate copies of switches to convert termios Bxxx constants to xxx as an integer. Use the shared termios_baud_to_number() routine to do the same conversion.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2008-05-23 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* console/console.c: Eliminate copies of switches to convert termios
|
||||
Bxxx constants to xxx as an integer. Use the shared
|
||||
termios_baud_to_number() routine to do the same conversion.
|
||||
|
||||
2008-05-15 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* network/network.c: Eliminate patterns that look like CVS conflict
|
||||
|
||||
@@ -278,64 +278,9 @@ conSetAttr(int minor, const struct termios *t)
|
||||
{
|
||||
int baud;
|
||||
|
||||
switch (t->c_cflag & CBAUD)
|
||||
{
|
||||
case B50:
|
||||
baud = 50;
|
||||
break;
|
||||
case B75:
|
||||
baud = 75;
|
||||
break;
|
||||
case B110:
|
||||
baud = 110;
|
||||
break;
|
||||
case B134:
|
||||
baud = 134;
|
||||
break;
|
||||
case B150:
|
||||
baud = 150;
|
||||
break;
|
||||
case B200:
|
||||
baud = 200;
|
||||
break;
|
||||
case B300:
|
||||
baud = 300;
|
||||
break;
|
||||
case B600:
|
||||
baud = 600;
|
||||
break;
|
||||
case B1200:
|
||||
baud = 1200;
|
||||
break;
|
||||
case B1800:
|
||||
baud = 1800;
|
||||
break;
|
||||
case B2400:
|
||||
baud = 2400;
|
||||
break;
|
||||
case B4800:
|
||||
baud = 4800;
|
||||
break;
|
||||
case B9600:
|
||||
baud = 9600;
|
||||
break;
|
||||
case B19200:
|
||||
baud = 19200;
|
||||
break;
|
||||
case B38400:
|
||||
baud = 38400;
|
||||
break;
|
||||
case B57600:
|
||||
baud = 57600;
|
||||
break;
|
||||
case B115200:
|
||||
baud = 115200;
|
||||
break;
|
||||
default:
|
||||
baud = 0;
|
||||
rtems_fatal_error_occurred (RTEMS_INTERNAL_ERROR);
|
||||
return 0;
|
||||
}
|
||||
baud = termios_baud_to_number(t->c_cflag & CBAUD);
|
||||
if ( baud > 115200 )
|
||||
rtems_fatal_error_occurred (RTEMS_INTERNAL_ERROR);
|
||||
|
||||
BSP_uart_set_baud(BSPConsolePort, baud);
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2008-05-23 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* console/console.c: Eliminate copies of switches to convert termios
|
||||
Bxxx constants to xxx as an integer. Use the shared
|
||||
termios_baud_to_number() routine to do the same conversion.
|
||||
|
||||
2008-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* startup/bspstart.c: Add capability for bootcard.c BSP Initialization
|
||||
|
||||
@@ -277,64 +277,9 @@ conSetAttr(int minor, const struct termios *t)
|
||||
{
|
||||
int baud;
|
||||
|
||||
switch (t->c_cflag & CBAUD)
|
||||
{
|
||||
case B50:
|
||||
baud = 50;
|
||||
break;
|
||||
case B75:
|
||||
baud = 75;
|
||||
break;
|
||||
case B110:
|
||||
baud = 110;
|
||||
break;
|
||||
case B134:
|
||||
baud = 134;
|
||||
break;
|
||||
case B150:
|
||||
baud = 150;
|
||||
break;
|
||||
case B200:
|
||||
baud = 200;
|
||||
break;
|
||||
case B300:
|
||||
baud = 300;
|
||||
break;
|
||||
case B600:
|
||||
baud = 600;
|
||||
break;
|
||||
case B1200:
|
||||
baud = 1200;
|
||||
break;
|
||||
case B1800:
|
||||
baud = 1800;
|
||||
break;
|
||||
case B2400:
|
||||
baud = 2400;
|
||||
break;
|
||||
case B4800:
|
||||
baud = 4800;
|
||||
break;
|
||||
case B9600:
|
||||
baud = 9600;
|
||||
break;
|
||||
case B19200:
|
||||
baud = 19200;
|
||||
break;
|
||||
case B38400:
|
||||
baud = 38400;
|
||||
break;
|
||||
case B57600:
|
||||
baud = 57600;
|
||||
break;
|
||||
case B115200:
|
||||
baud = 115200;
|
||||
break;
|
||||
default:
|
||||
baud = 0;
|
||||
rtems_fatal_error_occurred (RTEMS_INTERNAL_ERROR);
|
||||
return 0;
|
||||
}
|
||||
baud = termios_baud_to_number(t->c_cflag & CBAUD);
|
||||
if ( baud > 115200 )
|
||||
rtems_fatal_error_occurred (RTEMS_INTERNAL_ERROR);
|
||||
|
||||
BSP_uart_set_baud(BSPConsolePort, baud);
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2008-05-23 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* console/console.c: Eliminate copies of switches to convert termios
|
||||
Bxxx constants to xxx as an integer. Use the shared
|
||||
termios_baud_to_number() routine to do the same conversion.
|
||||
|
||||
2008-05-14 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* Makefile.am: Rework to avoid .rel files.
|
||||
|
||||
@@ -62,45 +62,6 @@ struct IntUartInfoStruct
|
||||
|
||||
struct IntUartInfoStruct IntUartInfo[MAX_UART_INFO];
|
||||
|
||||
static int GetBaud( int baudHandle )
|
||||
{
|
||||
int baud = 9600;
|
||||
switch ( baudHandle )
|
||||
{
|
||||
case B0:
|
||||
baud = (int)0;
|
||||
break;
|
||||
case B1200:
|
||||
baud = (int)1200;
|
||||
break;
|
||||
case B2400:
|
||||
baud = (int)2400;
|
||||
break;
|
||||
case B4800:
|
||||
baud = (int)4800;
|
||||
break;
|
||||
case B9600:
|
||||
baud = (int)9600;
|
||||
break;
|
||||
case B19200:
|
||||
baud = (int)19200;
|
||||
break;
|
||||
case B38400:
|
||||
baud = (int)38400;
|
||||
break;
|
||||
case B57600:
|
||||
baud = (int)57600;
|
||||
break;
|
||||
case B115200:
|
||||
baud = (int)115200;
|
||||
break;
|
||||
/* case B576000:
|
||||
baud = (int)576000; */
|
||||
break;
|
||||
}
|
||||
return ( baud );
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
Function : IntUartSet
|
||||
|
||||
@@ -212,7 +173,7 @@ IntUartSetAttributes(int minor, const struct termios *t)
|
||||
if ( t != (const struct termios *)0 )
|
||||
{
|
||||
/* determine baud rate index */
|
||||
baud = GetBaud( t->c_cflag & CBAUD );
|
||||
baud = termios_baud_to_number(t->c_cflag & CBAUD);
|
||||
|
||||
/* determine data bits */
|
||||
switch ( t->c_cflag & CSIZE )
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2008-05-23 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* console/console.c: Eliminate copies of switches to convert termios
|
||||
Bxxx constants to xxx as an integer. Use the shared
|
||||
termios_baud_to_number() routine to do the same conversion.
|
||||
|
||||
2008-05-14 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* Makefile.am: Rework to avoid .rel files.
|
||||
|
||||
@@ -83,33 +83,12 @@ smc1BRGC (int baud)
|
||||
static int
|
||||
smc1SetAttributes (int minor, const struct termios *t)
|
||||
{
|
||||
int baud;
|
||||
int baud;
|
||||
|
||||
switch (t->c_cflag & CBAUD) {
|
||||
default: baud = -1; break;
|
||||
case B50: baud = 50; break;
|
||||
case B75: baud = 75; break;
|
||||
case B110: baud = 110; break;
|
||||
case B134: baud = 134; break;
|
||||
case B150: baud = 150; break;
|
||||
case B200: baud = 200; break;
|
||||
case B300: baud = 300; break;
|
||||
case B600: baud = 600; break;
|
||||
case B1200: baud = 1200; break;
|
||||
case B1800: baud = 1800; break;
|
||||
case B2400: baud = 2400; break;
|
||||
case B4800: baud = 4800; break;
|
||||
case B9600: baud = 9600; break;
|
||||
case B19200: baud = 19200; break;
|
||||
case B38400: baud = 38400; break;
|
||||
case B57600: baud = 57600; break;
|
||||
case B115200: baud = 115200; break;
|
||||
case B230400: baud = 230400; break;
|
||||
case B460800: baud = 460800; break;
|
||||
}
|
||||
if (baud > 0)
|
||||
m360.brgc1 = smc1BRGC (baud);
|
||||
return 0;
|
||||
baud = termios_baud_to_number(t->c_cflag & CBAUD);
|
||||
if (baud > 0)
|
||||
m360.brgc1 = smc1BRGC (baud);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2008-05-23 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* console/console.c: Eliminate copies of switches to convert termios
|
||||
Bxxx constants to xxx as an integer. Use the shared
|
||||
termios_baud_to_number() routine to do the same conversion.
|
||||
|
||||
2008-05-14 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* Makefile.am: Rework to avoid .rel files.
|
||||
|
||||
@@ -62,42 +62,6 @@ struct IntUartInfoStruct
|
||||
|
||||
struct IntUartInfoStruct IntUartInfo[MAX_UART_INFO];
|
||||
|
||||
static int GetBaud( int baudHandle )
|
||||
{
|
||||
int baud = 9600;
|
||||
switch ( baudHandle )
|
||||
{
|
||||
case B0:
|
||||
baud = (int)0;
|
||||
break;
|
||||
case B1200:
|
||||
baud = (int)1200;
|
||||
break;
|
||||
case B2400:
|
||||
baud = (int)2400;
|
||||
break;
|
||||
case B4800:
|
||||
baud = (int)4800;
|
||||
break;
|
||||
case B9600:
|
||||
baud = (int)9600;
|
||||
break;
|
||||
case B19200:
|
||||
baud = (int)19200;
|
||||
break;
|
||||
case B38400:
|
||||
baud = (int)38400;
|
||||
break;
|
||||
case B57600:
|
||||
baud = (int)57600;
|
||||
break;
|
||||
case B115200:
|
||||
baud = (int)115200;
|
||||
break;
|
||||
}
|
||||
return ( baud );
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
Function : IntUartSet
|
||||
|
||||
@@ -209,7 +173,7 @@ IntUartSetAttributes(int minor, const struct termios *t)
|
||||
if ( t != (const struct termios *)0 )
|
||||
{
|
||||
/* determine baud rate index */
|
||||
baud = GetBaud( t->c_cflag & CBAUD );
|
||||
baud = termios_baud_to_number(t->c_cflag & CBAUD);
|
||||
|
||||
/* determine data bits */
|
||||
switch ( t->c_cflag & CSIZE )
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2008-05-23 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* console/console.c: Eliminate copies of switches to convert termios
|
||||
Bxxx constants to xxx as an integer. Use the shared
|
||||
termios_baud_to_number() routine to do the same conversion.
|
||||
|
||||
2008-05-14 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* Makefile.am: Rework to avoid .rel files.
|
||||
|
||||
@@ -815,53 +815,9 @@ int cd2401_setAttributes(
|
||||
|
||||
/* Determine what the line parameters should be */
|
||||
|
||||
/* Output baud rate */
|
||||
switch ( cfgetospeed (t) ) {
|
||||
default: out_baud = 9600; break;
|
||||
case B50: out_baud = 50; break;
|
||||
case B75: out_baud = 75; break;
|
||||
case B110: out_baud = 110; break;
|
||||
case B134: out_baud = 134; break;
|
||||
case B150: out_baud = 150; break;
|
||||
case B200: out_baud = 200; break;
|
||||
case B300: out_baud = 300; break;
|
||||
case B600: out_baud = 600; break;
|
||||
case B1200: out_baud = 1200; break;
|
||||
case B1800: out_baud = 1800; break;
|
||||
case B2400: out_baud = 2400; break;
|
||||
case B4800: out_baud = 4800; break;
|
||||
case B9600: out_baud = 9600; break;
|
||||
case B19200: out_baud = 19200; break;
|
||||
case B38400: out_baud = 38400; break;
|
||||
case B57600: out_baud = 57600; break;
|
||||
case B115200: out_baud = 115200; break;
|
||||
case B230400: out_baud = 230400; break;
|
||||
case B460800: out_baud = 460800; break;
|
||||
}
|
||||
|
||||
/* Input baud rate */
|
||||
switch ( cfgetispeed (t) ) {
|
||||
default: in_baud = out_baud; break;
|
||||
case B50: in_baud = 50; break;
|
||||
case B75: in_baud = 75; break;
|
||||
case B110: in_baud = 110; break;
|
||||
case B134: in_baud = 134; break;
|
||||
case B150: in_baud = 150; break;
|
||||
case B200: in_baud = 200; break;
|
||||
case B300: in_baud = 300; break;
|
||||
case B600: in_baud = 600; break;
|
||||
case B1200: in_baud = 1200; break;
|
||||
case B1800: in_baud = 1800; break;
|
||||
case B2400: in_baud = 2400; break;
|
||||
case B4800: in_baud = 4800; break;
|
||||
case B9600: in_baud = 9600; break;
|
||||
case B19200: in_baud = 19200; break;
|
||||
case B38400: in_baud = 38400; break;
|
||||
case B57600: in_baud = 57600; break;
|
||||
case B115200: in_baud = 115200; break;
|
||||
case B230400: in_baud = 230400; break;
|
||||
case B460800: in_baud = 460800; break;
|
||||
}
|
||||
/* baud rates */
|
||||
out_baud = termios_baud_to_number(t->c_cflag & CBAUD);
|
||||
in_baud = termios_baud_to_number(t->c_cflag & CBAUD);
|
||||
|
||||
/* Number of bits per char */
|
||||
csize = 0x07; /* to avoid a warning */
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2008-05-23 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* console/console.c: Eliminate copies of switches to convert termios
|
||||
Bxxx constants to xxx as an integer. Use the shared
|
||||
termios_baud_to_number() routine to do the same conversion.
|
||||
|
||||
2008-05-19 Eric Norum <norume@aps.anl.gov>
|
||||
|
||||
* Makefile.am, configure.ac, startup/bspstart.c, startup/linkcmds: Back
|
||||
|
||||
@@ -76,45 +76,6 @@ struct IntUartInfoStruct
|
||||
|
||||
struct IntUartInfoStruct IntUartInfo[MAX_UART_INFO];
|
||||
|
||||
static int GetBaud( int baudHandle )
|
||||
{
|
||||
int baud = 9600;
|
||||
switch ( baudHandle )
|
||||
{
|
||||
case B0:
|
||||
baud = (int)0;
|
||||
break;
|
||||
case B1200:
|
||||
baud = (int)1200;
|
||||
break;
|
||||
case B2400:
|
||||
baud = (int)2400;
|
||||
break;
|
||||
case B4800:
|
||||
baud = (int)4800;
|
||||
break;
|
||||
case B9600:
|
||||
baud = (int)9600;
|
||||
break;
|
||||
case B19200:
|
||||
baud = (int)19200;
|
||||
break;
|
||||
case B38400:
|
||||
baud = (int)38400;
|
||||
break;
|
||||
case B57600:
|
||||
baud = (int)57600;
|
||||
break;
|
||||
case B115200:
|
||||
baud = (int)115200;
|
||||
break;
|
||||
/* case B576000:
|
||||
baud = (int)576000; */
|
||||
break;
|
||||
}
|
||||
return ( baud );
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
Function : IntUartSet
|
||||
|
||||
@@ -226,7 +187,7 @@ IntUartSetAttributes(int minor, const struct termios *t)
|
||||
if ( t != (const struct termios *)0 )
|
||||
{
|
||||
/* determine baud rate index */
|
||||
baud = GetBaud( t->c_cflag & CBAUD );
|
||||
baud = termios_baud_to_number(t->c_cflag & CBAUD);
|
||||
|
||||
/* determine data bits */
|
||||
switch ( t->c_cflag & CSIZE )
|
||||
|
||||
Reference in New Issue
Block a user