2010-08-06 13:40:30 -06:00
|
|
|
#include <linux/tty.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/kallsyms.h>
|
|
|
|
#include <linux/semaphore.h>
|
|
|
|
#include <linux/sched.h>
|
|
|
|
|
2012-06-02 16:21:43 -06:00
|
|
|
/*
|
|
|
|
* The 'big tty mutex'
|
|
|
|
*
|
|
|
|
* This mutex is taken and released by tty_lock() and tty_unlock(),
|
|
|
|
* replacing the older big kernel lock.
|
|
|
|
* It can no longer be taken recursively, and does not get
|
|
|
|
* released implicitly while sleeping.
|
|
|
|
*
|
|
|
|
* Don't use in new code.
|
|
|
|
*/
|
|
|
|
static DEFINE_MUTEX(big_tty_mutex);
|
2012-05-31 03:35:18 -06:00
|
|
|
|
2010-08-06 13:40:30 -06:00
|
|
|
/*
|
|
|
|
* Getting the big tty mutex.
|
|
|
|
*/
|
2012-06-02 16:21:43 -06:00
|
|
|
void __lockfunc tty_lock(void)
|
2010-08-06 13:40:30 -06:00
|
|
|
{
|
2012-06-02 16:21:43 -06:00
|
|
|
mutex_lock(&big_tty_mutex);
|
2010-08-06 13:40:30 -06:00
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(tty_lock);
|
|
|
|
|
2012-06-02 16:21:43 -06:00
|
|
|
void __lockfunc tty_unlock(void)
|
2010-08-06 13:40:30 -06:00
|
|
|
{
|
2012-06-02 16:21:43 -06:00
|
|
|
mutex_unlock(&big_tty_mutex);
|
2010-08-06 13:40:30 -06:00
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(tty_unlock);
|