aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tty.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 9f47ab540f65..4990ef2b1fb7 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 */
@@ -605,8 +606,12 @@ extern long vt_compat_ioctl(struct tty_struct *tty,
605 606
606/* tty_mutex.c */ 607/* tty_mutex.c */
607/* functions for preparation of BKL removal */ 608/* functions for preparation of BKL removal */
608extern void __lockfunc tty_lock(void) __acquires(tty_lock); 609extern void __lockfunc tty_lock(struct tty_struct *tty);
609extern void __lockfunc tty_unlock(void) __releases(tty_lock); 610extern void __lockfunc tty_unlock(struct tty_struct *tty);
611extern void __lockfunc tty_lock_pair(struct tty_struct *tty,
612 struct tty_struct *tty2);
613extern void __lockfunc tty_unlock_pair(struct tty_struct *tty,
614 struct tty_struct *tty2);
610 615
611/* 616/*
612 * this shall be called only from where BTM is held (like close) 617 * this shall be called only from where BTM is held (like close)
@@ -621,9 +626,9 @@ extern void __lockfunc tty_unlock(void) __releases(tty_lock);
621static inline void tty_wait_until_sent_from_close(struct tty_struct *tty, 626static inline void tty_wait_until_sent_from_close(struct tty_struct *tty,
622 long timeout) 627 long timeout)
623{ 628{
624 tty_unlock(); /* tty->ops->close holds the BTM, drop it while waiting */ 629 tty_unlock(tty); /* tty->ops->close holds the BTM, drop it while waiting */
625 tty_wait_until_sent(tty, timeout); 630 tty_wait_until_sent(tty, timeout);
626 tty_lock(); 631 tty_lock(tty);
627} 632}
628 633
629/* 634/*
@@ -638,16 +643,16 @@ static inline void tty_wait_until_sent_from_close(struct tty_struct *tty,
638 * 643 *
639 * Do not use in new code. 644 * Do not use in new code.
640 */ 645 */
641#define wait_event_interruptible_tty(wq, condition) \ 646#define wait_event_interruptible_tty(tty, wq, condition) \
642({ \ 647({ \
643 int __ret = 0; \ 648 int __ret = 0; \
644 if (!(condition)) { \ 649 if (!(condition)) { \
645 __wait_event_interruptible_tty(wq, condition, __ret); \ 650 __wait_event_interruptible_tty(tty, wq, condition, __ret); \
646 } \ 651 } \
647 __ret; \ 652 __ret; \
648}) 653})
649 654
650#define __wait_event_interruptible_tty(wq, condition, ret) \ 655#define __wait_event_interruptible_tty(tty, wq, condition, ret) \
651do { \ 656do { \
652 DEFINE_WAIT(__wait); \ 657 DEFINE_WAIT(__wait); \
653 \ 658 \
@@ -656,9 +661,9 @@ do { \
656 if (condition) \ 661 if (condition) \
657 break; \ 662 break; \
658 if (!signal_pending(current)) { \ 663 if (!signal_pending(current)) { \
659 tty_unlock(); \ 664 tty_unlock(tty); \
660 schedule(); \ 665 schedule(); \
661 tty_lock(); \ 666 tty_lock(tty); \
662 continue; \ 667 continue; \
663 } \ 668 } \
664 ret = -ERESTARTSYS; \ 669 ret = -ERESTARTSYS; \