diff options
author | Alan Cox <alan@linux.intel.com> | 2012-07-14 10:31:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-16 16:00:41 -0400 |
commit | adc8d746caa67fff4b53ba3e5163a6cbacc3b523 (patch) | |
tree | e3f6c05f27c163b369ddd4da5f31d2a61bde6d3a /include | |
parent | 6d31a88cb2e01d46c0cb74aa5da529e1f92ae3db (diff) |
tty: move the termios object into the tty
This will let us sort out a whole pile of tty related races. The
alternative would be to keep points and refcount the termios objects.
However
1. They are tiny anyway
2. Many devices don't use the stored copies
3. We can remove a pty special case
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/tty.h | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index 40b18d7ad929..d5e75ee0f4d1 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -103,28 +103,28 @@ struct tty_bufhead { | |||
103 | #define TTY_PARITY 3 | 103 | #define TTY_PARITY 3 |
104 | #define TTY_OVERRUN 4 | 104 | #define TTY_OVERRUN 4 |
105 | 105 | ||
106 | #define INTR_CHAR(tty) ((tty)->termios->c_cc[VINTR]) | 106 | #define INTR_CHAR(tty) ((tty)->termios.c_cc[VINTR]) |
107 | #define QUIT_CHAR(tty) ((tty)->termios->c_cc[VQUIT]) | 107 | #define QUIT_CHAR(tty) ((tty)->termios.c_cc[VQUIT]) |
108 | #define ERASE_CHAR(tty) ((tty)->termios->c_cc[VERASE]) | 108 | #define ERASE_CHAR(tty) ((tty)->termios.c_cc[VERASE]) |
109 | #define KILL_CHAR(tty) ((tty)->termios->c_cc[VKILL]) | 109 | #define KILL_CHAR(tty) ((tty)->termios.c_cc[VKILL]) |
110 | #define EOF_CHAR(tty) ((tty)->termios->c_cc[VEOF]) | 110 | #define EOF_CHAR(tty) ((tty)->termios.c_cc[VEOF]) |
111 | #define TIME_CHAR(tty) ((tty)->termios->c_cc[VTIME]) | 111 | #define TIME_CHAR(tty) ((tty)->termios.c_cc[VTIME]) |
112 | #define MIN_CHAR(tty) ((tty)->termios->c_cc[VMIN]) | 112 | #define MIN_CHAR(tty) ((tty)->termios.c_cc[VMIN]) |
113 | #define SWTC_CHAR(tty) ((tty)->termios->c_cc[VSWTC]) | 113 | #define SWTC_CHAR(tty) ((tty)->termios.c_cc[VSWTC]) |
114 | #define START_CHAR(tty) ((tty)->termios->c_cc[VSTART]) | 114 | #define START_CHAR(tty) ((tty)->termios.c_cc[VSTART]) |
115 | #define STOP_CHAR(tty) ((tty)->termios->c_cc[VSTOP]) | 115 | #define STOP_CHAR(tty) ((tty)->termios.c_cc[VSTOP]) |
116 | #define SUSP_CHAR(tty) ((tty)->termios->c_cc[VSUSP]) | 116 | #define SUSP_CHAR(tty) ((tty)->termios.c_cc[VSUSP]) |
117 | #define EOL_CHAR(tty) ((tty)->termios->c_cc[VEOL]) | 117 | #define EOL_CHAR(tty) ((tty)->termios.c_cc[VEOL]) |
118 | #define REPRINT_CHAR(tty) ((tty)->termios->c_cc[VREPRINT]) | 118 | #define REPRINT_CHAR(tty) ((tty)->termios.c_cc[VREPRINT]) |
119 | #define DISCARD_CHAR(tty) ((tty)->termios->c_cc[VDISCARD]) | 119 | #define DISCARD_CHAR(tty) ((tty)->termios.c_cc[VDISCARD]) |
120 | #define WERASE_CHAR(tty) ((tty)->termios->c_cc[VWERASE]) | 120 | #define WERASE_CHAR(tty) ((tty)->termios.c_cc[VWERASE]) |
121 | #define LNEXT_CHAR(tty) ((tty)->termios->c_cc[VLNEXT]) | 121 | #define LNEXT_CHAR(tty) ((tty)->termios.c_cc[VLNEXT]) |
122 | #define EOL2_CHAR(tty) ((tty)->termios->c_cc[VEOL2]) | 122 | #define EOL2_CHAR(tty) ((tty)->termios.c_cc[VEOL2]) |
123 | 123 | ||
124 | #define _I_FLAG(tty, f) ((tty)->termios->c_iflag & (f)) | 124 | #define _I_FLAG(tty, f) ((tty)->termios.c_iflag & (f)) |
125 | #define _O_FLAG(tty, f) ((tty)->termios->c_oflag & (f)) | 125 | #define _O_FLAG(tty, f) ((tty)->termios.c_oflag & (f)) |
126 | #define _C_FLAG(tty, f) ((tty)->termios->c_cflag & (f)) | 126 | #define _C_FLAG(tty, f) ((tty)->termios.c_cflag & (f)) |
127 | #define _L_FLAG(tty, f) ((tty)->termios->c_lflag & (f)) | 127 | #define _L_FLAG(tty, f) ((tty)->termios.c_lflag & (f)) |
128 | 128 | ||
129 | #define I_IGNBRK(tty) _I_FLAG((tty), IGNBRK) | 129 | #define I_IGNBRK(tty) _I_FLAG((tty), IGNBRK) |
130 | #define I_BRKINT(tty) _I_FLAG((tty), BRKINT) | 130 | #define I_BRKINT(tty) _I_FLAG((tty), BRKINT) |
@@ -271,7 +271,7 @@ struct tty_struct { | |||
271 | struct mutex termios_mutex; | 271 | struct mutex termios_mutex; |
272 | spinlock_t ctrl_lock; | 272 | spinlock_t ctrl_lock; |
273 | /* Termios values are protected by the termios mutex */ | 273 | /* Termios values are protected by the termios mutex */ |
274 | struct ktermios *termios, *termios_locked; | 274 | struct ktermios termios, termios_locked; |
275 | struct termiox *termiox; /* May be NULL for unsupported */ | 275 | struct termiox *termiox; /* May be NULL for unsupported */ |
276 | char name[64]; | 276 | char name[64]; |
277 | struct pid *pgrp; /* Protected by ctrl lock */ | 277 | struct pid *pgrp; /* Protected by ctrl lock */ |