diff options
| author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2004-10-02 01:46:35 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-02 01:46:35 -0700 |
| commit | cf54a5af68a371d83b0aa0e4c14fc01dc4f09c45 (patch) | |
| tree | 7ccb387e4d763d28314c71e39b860deea55a6a53 /include/linux | |
| parent | d5978a21713e6c3788d5100115d17c9c3d18913c (diff) | |
[PATCH] Update termios to use per tty semaphore
This makes the agreed change of termios locking to be semaphore based
sleep locking. This is needed for USB in particular as it has to use
messaging to issue terminal mode changes.
This code passes Torvalds test grades 0, 1 and 2 (it looks ok, it
compiles and it booted). It does mean that a driver cannot take an
atomic peek at termios data during an interrupt. Nobody seems to be
doing this although some of the driver receive paths for line
disciplines will eventually want to (n_tty currently doesn't do this
locked on the receive path). Since the ldisc is given a chance to copy
any essential bits on the ->set_termios path this seems not to be a
problem.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/tty.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index 24b4a7383b53..f9fd14991956 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -244,6 +244,7 @@ struct tty_struct { struct tty_driver *driver; int index; struct tty_ldisc ldisc; + struct semaphore termios_sem; struct termios *termios, *termios_locked; char name[64]; int pgrp; |
