summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mauderer <Christian.Mauderer@embedded-brains.de>2014-07-03 12:55:42 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-07-09 13:33:06 +0200
commit8074342c9b0c315bc8e69cc0391e01972fe2ff95 (patch)
tree69df1aa2f03a54372631d8984f140ace55672261
parentbsps/sparc: Move APBUART printk support (diff)
downloadrtems-8074342c9b0c315bc8e69cc0391e01972fe2ff95.tar.bz2
termios: Add rtems_termios_get_termios()
-rw-r--r--cpukit/libcsupport/include/rtems/termiostypes.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/cpukit/libcsupport/include/rtems/termiostypes.h b/cpukit/libcsupport/include/rtems/termiostypes.h
index 80912b662e..df3ec0c2d7 100644
--- a/cpukit/libcsupport/include/rtems/termiostypes.h
+++ b/cpukit/libcsupport/include/rtems/termiostypes.h
@@ -78,7 +78,7 @@ typedef struct {
* @retval true Successful operation.
* @retval false Cannot open device.
*
- * @see rtems_termios_get_device_context().
+ * @see rtems_termios_get_device_context() and rtems_termios_get_termios().
*/
bool (*first_open)(
struct rtems_termios_tty *tty,
@@ -372,6 +372,19 @@ RTEMS_INLINE_ROUTINE void *rtems_termios_get_device_context(
return tty->device_context;
}
+/**
+ * @brief Returns the Termios structure.
+ *
+ * It can be used for example in the first open handler to adjust or obtain the
+ * initial attributes.
+ */
+RTEMS_INLINE_ROUTINE struct termios *rtems_termios_get_termios(
+ const rtems_termios_tty *tty
+)
+{
+ return &tty->termios;
+}
+
struct rtems_termios_linesw {
int (*l_open) (struct rtems_termios_tty *tp);
int (*l_close)(struct rtems_termios_tty *tp);