diff options
Diffstat (limited to '')
14 files changed, 38 insertions, 33 deletions
diff --git a/c/src/lib/libcpu/arm/at91rm9200/usart/usart.c b/c/src/lib/libcpu/arm/at91rm9200/usart/usart.c index c552899126..23b877ce64 100644 --- a/c/src/lib/libcpu/arm/at91rm9200/usart/usart.c +++ b/c/src/lib/libcpu/arm/at91rm9200/usart/usart.c @@ -240,7 +240,7 @@ static int usart_set_attributes(int minor, const struct termios *t) } else mode |= US_MR_PAR_NONE; - baud_requested = t->c_cflag & CBAUD; + baud_requested = t->c_ospeed; /* If not, set the dbgu console baud as USART baud default */ if (!baud_requested) diff --git a/c/src/lib/libcpu/arm/s3c24xx/include/s3c2400.h b/c/src/lib/libcpu/arm/s3c24xx/include/s3c2400.h index 092dcffe5c..89a3cf73d8 100644 --- a/c/src/lib/libcpu/arm/s3c24xx/include/s3c2400.h +++ b/c/src/lib/libcpu/arm/s3c24xx/include/s3c2400.h @@ -554,7 +554,7 @@ typedef union { /* 01 = BACK Porch. */ /* 10 = ACTIVE */ /* 11 = FRONT Porch */ - unsigned VSTATUS:2; /* TFT: Vertical Status (Read only). */ + unsigned _VSTATUS:2; /* TFT: Vertical Status (Read only). */ /* 00 = VSYNC */ /* 01 = BACK Porch. */ /* 10 = ACTIVE */ diff --git a/c/src/lib/libcpu/arm/s3c24xx/include/s3c2410.h b/c/src/lib/libcpu/arm/s3c24xx/include/s3c2410.h index d11bcf9d21..c6a0a0b452 100644 --- a/c/src/lib/libcpu/arm/s3c24xx/include/s3c2410.h +++ b/c/src/lib/libcpu/arm/s3c24xx/include/s3c2410.h @@ -702,7 +702,7 @@ typedef union { /* 01 = BACK Porch. */ /* 10 = ACTIVE */ /* 11 = FRONT Porch */ - unsigned VSTATUS:2; /* TFT: Vertical Status (Read only). */ + unsigned _VSTATUS:2; /* TFT: Vertical Status (Read only). */ /* 00 = VSYNC */ /* 01 = BACK Porch. */ /* 10 = ACTIVE */ diff --git a/c/src/lib/libcpu/bfin/serial/uart.c b/c/src/lib/libcpu/bfin/serial/uart.c index 79f09415c4..617c59dab3 100644 --- a/c/src/lib/libcpu/bfin/serial/uart.c +++ b/c/src/lib/libcpu/bfin/serial/uart.c @@ -9,7 +9,7 @@ * found in the file LICENSE in this distribution or at * http://www.rtems.org/license/LICENSE. */ - + #include <rtems.h> #include <rtems/libio.h> #include <rtems/termiostypes.h> @@ -159,7 +159,7 @@ static int setAttributes(int minor, const struct termios *termios) uint16_t lcr; base = uartsConfig->channels[minor].uart_baseAddress; - switch (termios->c_cflag & CBAUD) { + switch (termios->c_ospeed) { case B0: baud = 0; break; case B50: baud = 50; break; case B75: baud = 75; break; diff --git a/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c b/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c index f8101d7920..a500743bcd 100644 --- a/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c +++ b/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c @@ -362,7 +362,7 @@ static int mpc55xx_esci_termios_set_attributes( int minor, const struct termios cr1.B.TE = 1; /* Baud rate */ - switch (t->c_cflag & CBAUD) { + switch (t->c_ospeed) { case B50: br = 50; break; case B75: br = 75; break; case B110: br = 110; break; diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c b/c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c index 22fee2d719..c1de9c5020 100644 --- a/c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c +++ b/c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c @@ -190,7 +190,7 @@ m5xx_uart_setAttributes( return RTEMS_INVALID_NUMBER; /* Baud rate */ - baud = rtems_termios_baud_to_number( t->c_cflag & CBAUD ); + baud = rtems_termios_baud_to_number( t->c_ospeed ); if (baud > 0) { sccr0 &= ~QSMCM_SCI_BAUD(-1); sccr0 |= QSMCM_SCI_BAUD((bsp_clock_speed + (16 * baud)) / (32 * baud)); diff --git a/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c b/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c index e325acc3f1..4bfb6407eb 100644 --- a/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c +++ b/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c @@ -108,7 +108,7 @@ m8xx_smc_set_attributes (int minor, const struct termios *t) uint16_t clen=0, cstopb, parenb, parodd, cread; /* Baud rate */ - switch (t->c_cflag & CBAUD) { + switch (t->c_ospeed) { default: baud = -1; break; case B50: baud = 50; break; case B75: baud = 75; break; @@ -221,7 +221,7 @@ m8xx_scc_set_attributes (int minor, const struct termios *t) uint16_t csize=0, cstopb, parenb, parodd; /* Baud rate */ - switch (t->c_cflag & CBAUD) { + switch (t->c_ospeed) { default: baud = -1; break; case B50: baud = 50; break; case B75: baud = 75; break; diff --git a/c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c b/c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c index d7fd8b4dc5..e015a6497b 100644 --- a/c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c +++ b/c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c @@ -175,7 +175,7 @@ m8xx_smc_set_attributes (int minor, const struct termios *t) uint16_t clen=0, cstopb, parenb, parodd, cread; /* Baud rate */ - switch (t->c_cflag & CBAUD) { + switch (t->c_ospeed) { default: baud = -1; break; case B50: baud = 50; break; case B75: baud = 75; break; @@ -271,7 +271,7 @@ m8xx_scc_set_attributes (int minor, const struct termios *t) uint16_t csize=0, cstopb, parenb, parodd; /* Baud rate */ - switch (t->c_cflag & CBAUD) { + switch (t->c_ospeed) { default: baud = -1; break; case B50: baud = 50; break; case B75: baud = 75; break; diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console.c b/c/src/lib/libcpu/powerpc/ppc403/console/console.c index 0e74879947..0e0bbd7fef 100644 --- a/c/src/lib/libcpu/powerpc/ppc403/console/console.c +++ b/c/src/lib/libcpu/powerpc/ppc403/console/console.c @@ -224,7 +224,7 @@ spiSetAttributes (int minor, const struct termios *t) /* FIXME: check c_cflag & CRTSCTS for hardware flowcontrol */ /* FIXME: check and IMPLEMENT XON/XOFF */ - switch (t->c_cflag & CBAUD) { + switch (t->c_ospeed) { default: baud = -1; break; case B50: baud = 50; break; case B75: baud = 75; break; diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console405.c b/c/src/lib/libcpu/powerpc/ppc403/console/console405.c index cf936581c2..96c3534a75 100644 --- a/c/src/lib/libcpu/powerpc/ppc403/console/console405.c +++ b/c/src/lib/libcpu/powerpc/ppc403/console/console405.c @@ -216,7 +216,7 @@ spiSetAttributes (int minor, const struct termios *t) /* FIXME: check c_cflag & CRTSCTS for hardware flowcontrol */ /* FIXME: check and IMPLEMENT XON/XOFF */ - switch (t->c_cflag & CBAUD) { + switch (t->c_ospeed) { default: baud = -1; break; case B50: baud = 50; break; case B75: baud = 75; break; diff --git a/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c b/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c index 1d7b0135bd..3e79bbf9e4 100644 --- a/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c +++ b/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c @@ -181,7 +181,7 @@ tty0SetAttributes (int minor, const struct termios *t) /* FIXME: check c_cflag & CRTSCTS for hardware flow control */ /* FIXME: check and IMPLEMENT XON/XOFF */ - switch (t->c_cflag & CBAUD) { + switch (t->c_ospeed) { default: baud = -1; break; case B50: baud = 50; break; case B75: baud = 75; break; diff --git a/c/src/lib/libcpu/sh/sh7032/sci/sci.c b/c/src/lib/libcpu/sh/sh7032/sci/sci.c index c9db0fec73..04d9ca5c70 100644 --- a/c/src/lib/libcpu/sh/sh7032/sci/sci.c +++ b/c/src/lib/libcpu/sh/sh7032/sci/sci.c @@ -46,29 +46,31 @@ struct scidev_t { rtems_device_minor_number minor ; unsigned short opened ; tcflag_t cflags ; + speed_t spd ; } sci_device[SCI_MINOR_DEVICES] = { - { "/dev/sci0", SH_SCI_BASE_0, 0, 0, B9600 | CS8 }, - { "/dev/sci1", SH_SCI_BASE_1, 1, 0, B9600 | CS8 } + { "/dev/sci0", SH_SCI_BASE_0, 0, 0, CS8, B9600 }, + { "/dev/sci1", SH_SCI_BASE_1, 1, 0, CS8, B9600 } } ; /* imported from scitab.rel */ extern int _sci_get_brparms( - tcflag_t cflag, + speed_t spd, unsigned char *smr, unsigned char *brr ); /* Translate termios' tcflag_t into sci settings */ static int _sci_set_cflags( struct scidev_t *sci_dev, - tcflag_t c_cflag ) + tcflag_t c_cflag, + speed_t spd ) { uint8_t smr ; uint8_t brr ; - if ( c_cflag & CBAUD ) + if ( spd ) { - if ( _sci_get_brparms( c_cflag, &smr, &brr ) != 0 ) + if ( _sci_get_brparms( spd, &smr, &brr ) != 0 ) return -1 ; } @@ -239,7 +241,7 @@ rtems_device_driver sh_sci_open( temp8 = read8(sci_device[minor].addr + SCI_SCR); temp8 &= ~(SCI_TE | SCI_RE) ; write8(temp8, sci_device[minor].addr + SCI_SCR); /* Clear SCR */ - _sci_set_cflags( &sci_device[minor], sci_device[minor].cflags ); + _sci_set_cflags( &sci_device[minor], sci_device[minor].cflags, sci_device[minor].spd ); /* FIXME: Should be one bit delay */ CPU_delay(50000); /* microseconds */ @@ -250,7 +252,7 @@ rtems_device_driver sh_sci_open( temp8 = read8(sci_device[minor].addr + SCI_SCR); temp8 &= ~(SCI_TE | SCI_RE) ; write8(temp8, sci_device[minor].addr + SCI_SCR); /* Clear SCR */ - _sci_set_cflags( &sci_device[minor], sci_device[minor].cflags ); + _sci_set_cflags( &sci_device[minor], sci_device[minor].cflags, sci_device[minor].spd ); /* FIXME: Should be one bit delay */ CPU_delay(50000); /* microseconds */ diff --git a/c/src/lib/libcpu/sh/sh7045/sci/sci.c b/c/src/lib/libcpu/sh/sh7045/sci/sci.c index 690035a687..143fc1bb94 100644 --- a/c/src/lib/libcpu/sh/sh7045/sci/sci.c +++ b/c/src/lib/libcpu/sh/sh7045/sci/sci.c @@ -72,9 +72,9 @@ #define SH_SCI_BASE_0 SCI_SMR0 #define SH_SCI_BASE_1 SCI_SMR1 -#define SH_SCI_DEF_COMM_0 B9600 | CS8 -#define SH_SCI_DEF_COMM_1 B38400 | CS8 -/* #define SH_SCI_DEF_COMM_1 B9600 | CS8 */ +#define SH_SCI_DEF_COMM_0 CS8, B9600 +#define SH_SCI_DEF_COMM_1 CS8, B38400 +/* #define SH_SCI_DEF_COMM_1 CS8, B9600 */ struct scidev_t { char * name; @@ -82,6 +82,7 @@ struct scidev_t { rtems_device_minor_number minor; unsigned short opened; tcflag_t cflags; + speed_t spd; } sci_device[SCI_MINOR_DEVICES] = { { "/dev/sci0", SH_SCI_BASE_0, 0, 0, SH_SCI_DEF_COMM_0 }, @@ -96,15 +97,16 @@ static sci_setup_t sio_param[2]; /* Translate termios' tcflag_t into sci settings */ static int _sci_set_cflags( struct scidev_t *sci_dev, - tcflag_t c_cflag + tcflag_t c_cflag, + speed_t spd ) { uint8_t smr; uint8_t brr; - if ( c_cflag & CBAUD ) + if ( spd ) { - if ( _sci_get_brparms( c_cflag, &smr, &brr ) != 0 ) + if ( _sci_get_brparms( spd, &smr, &brr ) != 0 ) return -1; } @@ -351,7 +353,7 @@ rtems_device_driver sh_sci_open( /* set up SCI registers */ write8(0x00, sci_device[minor].addr + SCI_SCR); /* Clear SCR */ /* set SMR and BRR */ - _sci_set_cflags( &sci_device[minor], sci_device[minor].cflags ); + _sci_set_cflags( &sci_device[minor], sci_device[minor].cflags, sci_device[minor].spd ); for (a=0; a < 10000L; a++) { /* Delay */ __asm__ volatile ("nop"); @@ -526,7 +528,7 @@ static ssize_t _sh_sci_poll_write(int minor, const char *buf, size_t len) */ static int _sh_sci_set_attributes( int minor, const struct termios *t) { - return _sci_set_cflags( &sci_device[ minor ], t->c_cflag); + return _sci_set_cflags( &sci_device[ minor ], t->c_cflag, t->c_ospeed); } diff --git a/c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c b/c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c index db9040e409..5d588065af 100644 --- a/c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c +++ b/c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c @@ -59,7 +59,7 @@ * Automatically generated function imported from scitab.rel */ extern int _sci_get_brparms( - tcflag_t cflag, + speed_t spd, unsigned char *smr, unsigned char *brr ); @@ -77,9 +77,10 @@ int sh_sci_set_attributes( int a; tcflag_t c_cflag = t->c_cflag; + speed_t spd = t->c_ospeed; - if ( c_cflag & CBAUD ) { - if ( _sci_get_brparms( c_cflag, &smr, &brr ) != 0 ) + if ( spd ) { + if ( _sci_get_brparms( spd, &smr, &brr ) != 0 ) return -1 ; } |