summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/termios_baud2num.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2011-12-14 08:50:49 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2011-12-14 08:50:49 +0000
commit40f8b21ef432b5854ad09881ab8fbcbee18cf9e1 (patch)
treea6c8302378fd9d34761e915720325ae82a7dfebd /cpukit/libcsupport/src/termios_baud2num.c
parentRegenerate. (diff)
downloadrtems-40f8b21ef432b5854ad09881ab8fbcbee18cf9e1.tar.bz2
2011-12-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/include/rtems/termiostypes.h, libcsupport/src/termios_baud2num.c, libcsupport/src/termios_baudtable.c, libcsupport/src/termios_num2baud.c, libcsupport/src/termios_setinitialbaud.c: Added const qualifier to baud associations. Fixed integer types.
Diffstat (limited to 'cpukit/libcsupport/src/termios_baud2num.c')
-rw-r--r--cpukit/libcsupport/src/termios_baud2num.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/cpukit/libcsupport/src/termios_baud2num.c b/cpukit/libcsupport/src/termios_baud2num.c
index 57b908ebee..e9c279aa3d 100644
--- a/cpukit/libcsupport/src/termios_baud2num.c
+++ b/cpukit/libcsupport/src/termios_baud2num.c
@@ -10,24 +10,14 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+ #include "config.h"
#endif
-#include <sys/termios.h>
#include <rtems/termiostypes.h>
-#include <rtems/assoc.h>
-extern rtems_assoc_t termios_assoc_table[];
-
-int32_t rtems_termios_baud_to_number(
- int termios_baud
-)
+rtems_termios_baud_t rtems_termios_baud_to_number(tcflag_t c_cflag)
{
- int baud;
-
- baud = rtems_assoc_local_by_remote( termios_assoc_table, termios_baud );
- if ( baud == 0 && termios_baud != 0 )
- return -1;
+ uint32_t remote_value = (uint32_t) (c_cflag & CBAUD);
- return baud;
+ return rtems_assoc_local_by_remote(rtems_termios_baud_table, remote_value);
}