2 #include <linux/module.h>
3 #include <linux/kallsyms.h>
4 #include <linux/semaphore.h>
5 #include <linux/sched.h>
7 /* Legacy tty mutex glue */
10 * Getting the big tty mutex.
13 void __lockfunc tty_lock(struct tty_struct *tty)
15 if (tty->magic != TTY_MAGIC) {
16 printk(KERN_ERR "L Bad %p\n", tty);
21 mutex_lock(&tty->legacy_mutex);
23 EXPORT_SYMBOL(tty_lock);
25 void __lockfunc tty_unlock(struct tty_struct *tty)
27 if (tty->magic != TTY_MAGIC) {
28 printk(KERN_ERR "U Bad %p\n", tty);
32 mutex_unlock(&tty->legacy_mutex);
35 EXPORT_SYMBOL(tty_unlock);
38 * Getting the big tty mutex for a pair of ttys with lock ordering
39 * On a non pty/tty pair tty2 can be NULL which is just fine.
41 void __lockfunc tty_lock_pair(struct tty_struct *tty,
42 struct tty_struct *tty2)
48 if (tty2 && tty2 != tty)
53 EXPORT_SYMBOL(tty_lock_pair);
55 void __lockfunc tty_unlock_pair(struct tty_struct *tty,
56 struct tty_struct *tty2)
59 if (tty2 && tty2 != tty)
62 EXPORT_SYMBOL(tty_unlock_pair);