summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/m68k
diff options
context:
space:
mode:
authorKevin Kirspel <kevin-kirspel@idexx.com>2017-03-21 15:39:48 -0400
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-03-22 11:55:04 +0100
commit1c6926c11f2e5efcb166c668b097d64a0321d66e (patch)
tree30683dcf11979f51273413aade68a3828d00da10 /c/src/lib/libbsp/m68k
parentbsp/atsam: Fix DMA support of some drivers (diff)
downloadrtems-1c6926c11f2e5efcb166c668b097d64a0321d66e.tar.bz2
termios: Synchronize with latest FreeBSD headers
Adding modified FreeBSD headers to synchronize RTEMS termios with FreeBSD. Modify termios to support dedicated input and output baud for termios structure. Updated BSPs to use dedicated input and output baud in termios structure. Updated tools to use dedicated input and output baud in termios structure. Updated termios testsuites to use dedicated input and output baud in termios structure. Close #2897.
Diffstat (limited to 'c/src/lib/libbsp/m68k')
-rw-r--r--c/src/lib/libbsp/m68k/av5282/console/console.c6
-rw-r--r--c/src/lib/libbsp/m68k/gen68340/console/console.c18
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/console/console.c2
-rw-r--r--c/src/lib/libbsp/m68k/genmcf548x/console/console.c2
-rw-r--r--c/src/lib/libbsp/m68k/mcf52235/console/console.c8
-rw-r--r--c/src/lib/libbsp/m68k/mcf5225x/console/console.c24
-rw-r--r--c/src/lib/libbsp/m68k/mcf5235/console/console.c8
-rw-r--r--c/src/lib/libbsp/m68k/mcf5329/console/console.c8
-rw-r--r--c/src/lib/libbsp/m68k/mrm332/console/sci.c2
-rw-r--r--c/src/lib/libbsp/m68k/mvme167/console/console.c8
-rw-r--r--c/src/lib/libbsp/m68k/uC5282/console/console.c4
11 files changed, 44 insertions, 46 deletions
diff --git a/c/src/lib/libbsp/m68k/av5282/console/console.c b/c/src/lib/libbsp/m68k/av5282/console/console.c
index 07a1569d58..f56305a970 100644
--- a/c/src/lib/libbsp/m68k/av5282/console/console.c
+++ b/c/src/lib/libbsp/m68k/av5282/console/console.c
@@ -179,7 +179,7 @@ static int IntUartSetAttributes(
/* check to see if input is valid */
if ( t != (const struct termios *)0 ) {
/* determine baud rate index */
- baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
+ baud = rtems_termios_baud_to_number(t->c_ospeed);
/* determine data bits */
switch ( t->c_cflag & CSIZE ) {
@@ -240,7 +240,7 @@ static int IntUartSetAttributes(
* Description : This is the interrupt handler for the internal uart. It
* determines which channel caused the interrupt before queueing any received
* chars and dequeueing chars waiting for transmission.
- */
+ */
static rtems_isr IntUartInterruptHandler(rtems_vector_number v)
{
unsigned int chan = v - UART_INTC0_IRQ_VECTOR(0);
@@ -303,7 +303,7 @@ static rtems_isr IntUartInterruptHandler(rtems_vector_number v)
* Description : This initialises the internal uart hardware for all
* internal uarts. If the internal uart is to be interrupt driven then the
* interrupt vectors are hooked.
- */
+ */
static void IntUartInitialize(void)
{
unsigned int chan;
diff --git a/c/src/lib/libbsp/m68k/gen68340/console/console.c b/c/src/lib/libbsp/m68k/gen68340/console/console.c
index dd38559fb1..d6634b1079 100644
--- a/c/src/lib/libbsp/m68k/gen68340/console/console.c
+++ b/c/src/lib/libbsp/m68k/gen68340/console/console.c
@@ -474,20 +474,10 @@ SetAttributes (int minor, const struct termios *t)
{
rtems_interrupt_level level;
float ispeed, ospeed;
- int isp, osp;
-
- /* output speed */
- if (t->c_cflag & CBAUDEX)
- osp = (t->c_cflag & CBAUD) + CBAUD + 1;
- else
- osp = t->c_cflag & CBAUD;
-
- /* input speed */
- isp = (t->c_cflag / (CIBAUD / CBAUD)) & CBAUD;
/* convert it */
- ispeed = rtems_termios_baud_to_number(isp);
- ospeed = rtems_termios_baud_to_number(osp);
+ ispeed = rtems_termios_baud_to_number(t->c_ispeed);
+ ospeed = rtems_termios_baud_to_number(t->c_ospeed);
if (ispeed || ospeed) {
/* update config table */
@@ -515,7 +505,7 @@ SetAttributes (int minor, const struct termios *t)
}
/* if serial module configuration has been changed */
- if (t->c_cflag & (CBAUD | CIBAUD | CSIZE | PARENB)) {
+ if (t->c_cflag & (CSIZE | PARENB)) {
rtems_interrupt_disable(level);
/* reinit the UART */
dbugInitialise();
@@ -693,7 +683,7 @@ rtems_device_driver console_control(
{
rtems_libio_ioctl_args_t *args = arg;
- if (args->command == RTEMS_IO_SET_ATTRIBUTES)
+ if (args->command == TIOCSETA)
SetAttributes (minor, (struct termios *)args->buffer);
return rtems_termios_ioctl (arg);
diff --git a/c/src/lib/libbsp/m68k/gen68360/console/console.c b/c/src/lib/libbsp/m68k/gen68360/console/console.c
index 1a8ed0026f..36d8470168 100644
--- a/c/src/lib/libbsp/m68k/gen68360/console/console.c
+++ b/c/src/lib/libbsp/m68k/gen68360/console/console.c
@@ -86,7 +86,7 @@ smc1SetAttributes (int minor, const struct termios *t)
{
int baud;
- baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
+ baud = rtems_termios_baud_to_number(t->c_ospeed);
if (baud > 0)
m360.brgc1 = smc1BRGC (baud);
return 0;
diff --git a/c/src/lib/libbsp/m68k/genmcf548x/console/console.c b/c/src/lib/libbsp/m68k/genmcf548x/console/console.c
index 6891e768e5..23186fcfdf 100644
--- a/c/src/lib/libbsp/m68k/genmcf548x/console/console.c
+++ b/c/src/lib/libbsp/m68k/genmcf548x/console/console.c
@@ -307,7 +307,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 = GetBaud( t->c_ospeed );
/* determine data bits */
switch ( t->c_cflag & CSIZE )
diff --git a/c/src/lib/libbsp/m68k/mcf52235/console/console.c b/c/src/lib/libbsp/m68k/mcf52235/console/console.c
index 50c642a021..c2b6e36bfa 100644
--- a/c/src/lib/libbsp/m68k/mcf52235/console/console.c
+++ b/c/src/lib/libbsp/m68k/mcf52235/console/console.c
@@ -152,7 +152,7 @@ static int IntUartSetAttributes(int minor, const struct termios *t)
/* check to see if input is valid */
if (t != (const struct termios *) 0) {
/* determine baud rate index */
- baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
+ baud = rtems_termios_baud_to_number(t->c_ospeed);
/* determine data bits */
switch (t->c_cflag & CSIZE) {
@@ -598,8 +598,10 @@ rtems_device_driver console_open(rtems_device_major_number major,
struct termios term;
if (tcgetattr(STDIN_FILENO, &term) >= 0) {
- term.c_cflag &= ~(CBAUD | CSIZE);
- term.c_cflag |= CS8 | B19200;
+ term.c_cflag &= ~(CSIZE);
+ term.c_cflag |= CS8;
+ term.c_ispeed = B19200;
+ term.c_ospeed = B19200;
tcsetattr(STDIN_FILENO, TCSANOW, &term);
}
}
diff --git a/c/src/lib/libbsp/m68k/mcf5225x/console/console.c b/c/src/lib/libbsp/m68k/mcf5225x/console/console.c
index 63bb644682..9e36e3945a 100644
--- a/c/src/lib/libbsp/m68k/mcf5225x/console/console.c
+++ b/c/src/lib/libbsp/m68k/mcf5225x/console/console.c
@@ -150,7 +150,7 @@ IntUartSet(int minor, int baud, int databits, int parity, int stopbits,
Description : This provides the hardware-dependent portion of tcsetattr().
value and sets it. At the moment this just sets the baud rate.
- Note: The highest baudrate is 115200 as this stays within
+ Note: The highest baudrate is 115200 as this stays within
an error of +/- 5% at 25MHz processor clock
***************************************************************************/
static int IntUartSetAttributes(int minor, const struct termios *t)
@@ -166,7 +166,7 @@ static int IntUartSetAttributes(int minor, const struct termios *t)
/* check to see if input is valid */
if (t != (const struct termios *) 0) {
/* determine baud rate index */
- baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
+ baud = rtems_termios_baud_to_number(t->c_ospeed);
/* determine data bits */
switch (t->c_cflag & CSIZE) {
@@ -243,7 +243,7 @@ static rtems_isr IntUartInterruptHandler(rtems_vector_number v)
else
MCF_GPIO_PORTTC |= MCF_GPIO_PORTTC_PORTTC0;
#endif
-
+
/* read data and put into the receive buffer */
while (MCF_UART_USR(chan) & MCF_UART_USR_RXRDY) {
@@ -359,9 +359,9 @@ static void IntUartInitialize(void)
/***************************************************************************
Function : IntUartInterruptWrite
- Description : This writes a single character to the appropriate uart
+ Description : This writes a single character to the appropriate uart
channel. This is either called during an interrupt or in the user's task
- to initiate a transmit sequence. Calling this routine enables Tx
+ to initiate a transmit sequence. Calling this routine enables Tx
interrupts.
***************************************************************************/
static ssize_t IntUartInterruptWrite(int minor, const char *buf, size_t len)
@@ -476,7 +476,7 @@ static int IntUartTaskRead(int minor)
/***************************************************************************
Function : IntUartPollRead
- Description : This reads a character from the internal uart. It returns
+ Description : This reads a character from the internal uart. It returns
to the caller without blocking if not character is waiting.
***************************************************************************/
static
@@ -491,8 +491,8 @@ int IntUartPollRead(int minor)
/***************************************************************************
Function : IntUartPollWrite
- Description : This writes out each character in the buffer to the
- appropriate internal uart channel waiting till each one is sucessfully
+ Description : This writes out each character in the buffer to the
+ appropriate internal uart channel waiting till each one is sucessfully
transmitted.
***************************************************************************/
static ssize_t IntUartPollWrite(int minor, const char *buf, size_t len)
@@ -562,7 +562,7 @@ rtems_device_driver console_initialize(rtems_device_major_number major,
/***************************************************************************
Function : console_open
- Description : This actually opens the device depending on the minor
+ Description : This actually opens the device depending on the minor
number set during initialisation. The device specific access routines are
passed to termios when the devices is opened depending on whether it is
polled or not.
@@ -631,8 +631,10 @@ rtems_device_driver console_open(rtems_device_major_number major,
struct termios term;
if (tcgetattr(STDIN_FILENO, &term) >= 0) {
- term.c_cflag &= ~(CBAUD | CSIZE);
- term.c_cflag |= CS8 | B115200;
+ term.c_cflag &= ~(CSIZE);
+ term.c_cflag |= CS8;
+ term.c_ispeed = B115200;
+ term.c_ospeed = B115200;
tcsetattr(STDIN_FILENO, TCSANOW, &term);
}
}
diff --git a/c/src/lib/libbsp/m68k/mcf5235/console/console.c b/c/src/lib/libbsp/m68k/mcf5235/console/console.c
index 3f50b6adac..6fd92aa557 100644
--- a/c/src/lib/libbsp/m68k/mcf5235/console/console.c
+++ b/c/src/lib/libbsp/m68k/mcf5235/console/console.c
@@ -174,7 +174,7 @@ IntUartSetAttributes(int minor, const struct termios *t)
if ( t != (const struct termios *)0 )
{
/* determine baud rate index */
- baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
+ baud = rtems_termios_baud_to_number(t->c_ospeed);
/* determine data bits */
switch ( t->c_cflag & CSIZE )
@@ -681,8 +681,10 @@ rtems_device_driver console_open(
struct termios term;
if (tcgetattr (STDIN_FILENO, &term) >= 0)
{
- term.c_cflag &= ~(CBAUD | CSIZE);
- term.c_cflag |= CS8 | B19200;
+ term.c_cflag &= ~(CSIZE);
+ term.c_cflag |= CS8;
+ term.c_ispeed = B19200;
+ term.c_ospeed = B19200;
tcsetattr (STDIN_FILENO, TCSANOW, &term);
}
}
diff --git a/c/src/lib/libbsp/m68k/mcf5329/console/console.c b/c/src/lib/libbsp/m68k/mcf5329/console/console.c
index dfae857533..ba4a7d981a 100644
--- a/c/src/lib/libbsp/m68k/mcf5329/console/console.c
+++ b/c/src/lib/libbsp/m68k/mcf5329/console/console.c
@@ -170,7 +170,7 @@ static int IntUartSetAttributes(int minor, const struct termios *t)
/* check to see if input is valid */
if (t != (const struct termios *) 0) {
/* determine baud rate index */
- baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
+ baud = rtems_termios_baud_to_number(t->c_ospeed);
/* determine data bits */
switch (t->c_cflag & CSIZE) {
@@ -613,8 +613,10 @@ rtems_device_driver console_open(rtems_device_major_number major,
struct termios term;
if (tcgetattr(STDIN_FILENO, &term) >= 0) {
- term.c_cflag &= ~(CBAUD | CSIZE);
- term.c_cflag |= CS8 | B19200;
+ term.c_cflag &= ~(CSIZE);
+ term.c_cflag |= CS8;
+ term.c_ispeed = B19200;
+ term.c_ospeed = B19200;
tcsetattr(STDIN_FILENO, TCSANOW, &term);
}
}
diff --git a/c/src/lib/libbsp/m68k/mrm332/console/sci.c b/c/src/lib/libbsp/m68k/mrm332/console/sci.c
index a0f8cc0820..1e92d6d774 100644
--- a/c/src/lib/libbsp/m68k/mrm332/console/sci.c
+++ b/c/src/lib/libbsp/m68k/mrm332/console/sci.c
@@ -675,7 +675,7 @@ int SciSetAttributes(
/* if you look closely you will see this is the only thing we use */
/* set the baud rate */
- baud_requested = t->c_cflag & CBAUD; /* baud rate */
+ baud_requested = t->c_ospeed; /* baud rate */
if (!baud_requested)
{
diff --git a/c/src/lib/libbsp/m68k/mvme167/console/console.c b/c/src/lib/libbsp/m68k/mvme167/console/console.c
index 9ac8f7076f..3b7aecb541 100644
--- a/c/src/lib/libbsp/m68k/mvme167/console/console.c
+++ b/c/src/lib/libbsp/m68k/mvme167/console/console.c
@@ -725,7 +725,7 @@ int cd2401_firstOpen(
* We could have made a tcgetattr() call if we had our fd.
*/
newarg.iop = args->iop;
- newarg.command = RTEMS_IO_GET_ATTRIBUTES;
+ newarg.command = TIOCGETA;
newarg.buffer = &termios;
sc = rtems_termios_ioctl (&newarg);
if (sc != RTEMS_SUCCESSFUL)
@@ -738,7 +738,7 @@ int cd2401_firstOpen(
* on the ttyMutex that it already owns; this is safe in RTEMS.
*/
termios.c_cflag |= CLOCAL; /* Ignore modem status lines */
- newarg.command = RTEMS_IO_SET_ATTRIBUTES;
+ newarg.command = TIOCGETA;
sc = rtems_termios_ioctl (&newarg);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
@@ -844,8 +844,8 @@ int cd2401_setAttributes(
/* Determine what the line parameters should be */
/* baud rates */
- out_baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
- in_baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
+ out_baud = rtems_termios_baud_to_number(t->c_ospeed);
+ in_baud = rtems_termios_baud_to_number(t->c_ispeed);
/* Number of bits per char */
csize = 0x07; /* to avoid a warning */
diff --git a/c/src/lib/libbsp/m68k/uC5282/console/console.c b/c/src/lib/libbsp/m68k/uC5282/console/console.c
index 0f08cea94f..e2c29c0914 100644
--- a/c/src/lib/libbsp/m68k/uC5282/console/console.c
+++ b/c/src/lib/libbsp/m68k/uC5282/console/console.c
@@ -190,7 +190,7 @@ IntUartSetAttributes(int minor, const struct termios *t)
if ( t != (const struct termios *)0 )
{
/* determine baud rate index */
- baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
+ baud = rtems_termios_baud_to_number(t->c_ospeed);
/* determine data bits */
switch ( t->c_cflag & CSIZE )
@@ -447,7 +447,7 @@ IntUartInterruptOpen(int major, int minor, void *arg)
MCF5282_GPIO_PUAPAR |= MCF5282_GPIO_PUAPAR_PUAPA3|MCF5282_GPIO_PUAPAR_PUAPA2;
break;
case 2:
- MCF5282_GPIO_PASPAR =
+ MCF5282_GPIO_PASPAR =
(MCF5282_GPIO_PASPAR
& ~(MCF5282_GPIO_PASPAR_PASPA3(3)|MCF5282_GPIO_PASPAR_PASPA2(3)))
| (MCF5282_GPIO_PASPAR_PASPA3(2)|MCF5282_GPIO_PASPAR_PASPA2(2));