[rtems commit] termios: Add rtems_termios_get_termios()

Sebastian Huber sebh at rtems.org
Wed Jul 9 11:25:37 UTC 2014


Module:    rtems
Branch:    master
Commit:    8074342c9b0c315bc8e69cc0391e01972fe2ff95
Changeset: http://git.rtems.org/rtems/commit/?id=8074342c9b0c315bc8e69cc0391e01972fe2ff95

Author:    Christian Mauderer <Christian.Mauderer at embedded-brains.de>
Date:      Thu Jul  3 12:55:42 2014 +0200

termios: Add rtems_termios_get_termios()

---

 cpukit/libcsupport/include/rtems/termiostypes.h |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/cpukit/libcsupport/include/rtems/termiostypes.h b/cpukit/libcsupport/include/rtems/termiostypes.h
index 80912b6..df3ec0c 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);



More information about the vc mailing list