2010-08-07 03:40:30 +08:00
|
|
|
#include <linux/tty.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/kallsyms.h>
|
|
|
|
#include <linux/semaphore.h>
|
|
|
|
#include <linux/sched.h>
|
|
|
|
|
2012-06-03 06:21:43 +08: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 17:35:18 +08:00
|
|
|
|
2010-08-07 03:40:30 +08:00
|
|
|
/*
|
|
|
|
* Getting the big tty mutex.
|
|
|
|
*/
|
2012-06-03 06:21:43 +08:00
|
|
|
void __lockfunc tty_lock(void)
|
2010-08-07 03:40:30 +08:00
|
|
|
{
|
2012-06-03 06:21:43 +08:00
|
|
|
mutex_lock(&big_tty_mutex);
|
2010-08-07 03:40:30 +08:00
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(tty_lock);
|
|
|
|
|
2012-06-03 06:21:43 +08:00
|
|
|
void __lockfunc tty_unlock(void)
|
2010-08-07 03:40:30 +08:00
|
|
|
{
|
2012-06-03 06:21:43 +08:00
|
|
|
mutex_unlock(&big_tty_mutex);
|
2010-08-07 03:40:30 +08:00
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(tty_unlock);
|