diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2014-09-10 23:06:33 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-24 08:19:35 +0400 |
commit | c545b66c6922b002b5fe224a6eaec58c913650b5 (patch) | |
tree | 6a979922aeb32f1100d0f6074b2c2d652d6bf931 /include/linux/tty.h | |
parent | 01adc80706f80a583948db6768c5571204cd5f99 (diff) | |
download | linux-c545b66c6922b002b5fe224a6eaec58c913650b5.tar.xz |
tty: Serialize tcflow() with other tty flow control changes
Use newly-introduced tty->flow_lock to serialize updates to
tty->flow_stopped (via tcflow()) and with concurrent tty flow
control changes from other sources.
Merge the storage for ->stopped and ->flow_stopped, now that both
flags are serialized by ->flow_lock.
The padding bits are necessary to force the compiler to allocate the
type specified; otherwise, gcc will ignore the type specifier and
allocate the minimum number of bytes necessary to store the bitfield.
In turn, this would allow Alpha EV4 and EV5 cpus to corrupt adjacent
byte storage because those cpus use RMW to store byte and short data.
gcc versions < 4.7.2 will also corrupt storage adjacent to bitfields
smaller than unsigned long on ia64, ppc64, hppa64 and sparc64, thus
requiring more than unsigned int storage (which would otherwise be
sufficient to workaround the Alpha non-atomic byte/short storage problem).
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r-- | include/linux/tty.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index fd4148d3a261..d80b53642f2c 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -262,8 +262,9 @@ struct tty_struct { unsigned long flags; int count; struct winsize winsize; /* winsize_mutex */ - int stopped; /* flow_lock */ - int flow_stopped; + unsigned long stopped:1, /* flow_lock */ + flow_stopped:1, + unused:62; int hw_stopped; int packet; unsigned char ctrl_status; /* ctrl_lock */ |