diff options
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r-- | include/linux/tty.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index 40b18d7ad929..7f9d7df9b131 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -268,6 +268,7 @@ struct tty_struct { | |||
268 | struct mutex ldisc_mutex; | 268 | struct mutex ldisc_mutex; |
269 | struct tty_ldisc *ldisc; | 269 | struct tty_ldisc *ldisc; |
270 | 270 | ||
271 | struct mutex legacy_mutex; | ||
271 | struct mutex termios_mutex; | 272 | struct mutex termios_mutex; |
272 | spinlock_t ctrl_lock; | 273 | spinlock_t ctrl_lock; |
273 | /* Termios values are protected by the termios mutex */ | 274 | /* Termios values are protected by the termios mutex */ |
@@ -610,8 +611,12 @@ extern long vt_compat_ioctl(struct tty_struct *tty, | |||
610 | 611 | ||
611 | /* tty_mutex.c */ | 612 | /* tty_mutex.c */ |
612 | /* functions for preparation of BKL removal */ | 613 | /* functions for preparation of BKL removal */ |
613 | extern void __lockfunc tty_lock(void) __acquires(tty_lock); | 614 | extern void __lockfunc tty_lock(struct tty_struct *tty); |
614 | extern void __lockfunc tty_unlock(void) __releases(tty_lock); | 615 | extern void __lockfunc tty_unlock(struct tty_struct *tty); |
616 | extern void __lockfunc tty_lock_pair(struct tty_struct *tty, | ||
617 | struct tty_struct *tty2); | ||
618 | extern void __lockfunc tty_unlock_pair(struct tty_struct *tty, | ||
619 | struct tty_struct *tty2); | ||
615 | 620 | ||
616 | /* | 621 | /* |
617 | * this shall be called only from where BTM is held (like close) | 622 | * this shall be called only from where BTM is held (like close) |
@@ -626,9 +631,9 @@ extern void __lockfunc tty_unlock(void) __releases(tty_lock); | |||
626 | static inline void tty_wait_until_sent_from_close(struct tty_struct *tty, | 631 | static inline void tty_wait_until_sent_from_close(struct tty_struct *tty, |
627 | long timeout) | 632 | long timeout) |
628 | { | 633 | { |
629 | tty_unlock(); /* tty->ops->close holds the BTM, drop it while waiting */ | 634 | tty_unlock(tty); /* tty->ops->close holds the BTM, drop it while waiting */ |
630 | tty_wait_until_sent(tty, timeout); | 635 | tty_wait_until_sent(tty, timeout); |
631 | tty_lock(); | 636 | tty_lock(tty); |
632 | } | 637 | } |
633 | 638 | ||
634 | /* | 639 | /* |
@@ -643,16 +648,16 @@ static inline void tty_wait_until_sent_from_close(struct tty_struct *tty, | |||
643 | * | 648 | * |
644 | * Do not use in new code. | 649 | * Do not use in new code. |
645 | */ | 650 | */ |
646 | #define wait_event_interruptible_tty(wq, condition) \ | 651 | #define wait_event_interruptible_tty(tty, wq, condition) \ |
647 | ({ \ | 652 | ({ \ |
648 | int __ret = 0; \ | 653 | int __ret = 0; \ |
649 | if (!(condition)) { \ | 654 | if (!(condition)) { \ |
650 | __wait_event_interruptible_tty(wq, condition, __ret); \ | 655 | __wait_event_interruptible_tty(tty, wq, condition, __ret); \ |
651 | } \ | 656 | } \ |
652 | __ret; \ | 657 | __ret; \ |
653 | }) | 658 | }) |
654 | 659 | ||
655 | #define __wait_event_interruptible_tty(wq, condition, ret) \ | 660 | #define __wait_event_interruptible_tty(tty, wq, condition, ret) \ |
656 | do { \ | 661 | do { \ |
657 | DEFINE_WAIT(__wait); \ | 662 | DEFINE_WAIT(__wait); \ |
658 | \ | 663 | \ |
@@ -661,9 +666,9 @@ do { \ | |||
661 | if (condition) \ | 666 | if (condition) \ |
662 | break; \ | 667 | break; \ |
663 | if (!signal_pending(current)) { \ | 668 | if (!signal_pending(current)) { \ |
664 | tty_unlock(); \ | 669 | tty_unlock(tty); \ |
665 | schedule(); \ | 670 | schedule(); \ |
666 | tty_lock(); \ | 671 | tty_lock(tty); \ |
667 | continue; \ | 672 | continue; \ |
668 | } \ | 673 | } \ |
669 | ret = -ERESTARTSYS; \ | 674 | ret = -ERESTARTSYS; \ |