From 7c31a0c3a60724ba4415f5559c6424faf2e035c7 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 21 Feb 2011 14:32:23 -0800 Subject: [PATCH] compat: backport tty_{lock,unlock,locked} Signed-off-by: Hauke Mehrtens --- include/linux/compat-2.6.36.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h index 74d2309d441a..0e3b77470ec6 100644 --- a/include/linux/compat-2.6.36.h +++ b/include/linux/compat-2.6.36.h @@ -9,6 +9,7 @@ #include #include #include +#include #define kparam_block_sysfs_write(a) #define kparam_unblock_sysfs_write(a) @@ -101,6 +102,23 @@ int no_printk(const char *s, ...) { return 0; } #define alloc_workqueue(name, flags, max_active) __create_workqueue(name, flags, max_active, 0) #endif +#define EXTPROC 0200000 +#define TIOCPKT_IOCTL 64 + +static inline void tty_lock(void) __acquires(kernel_lock) +{ +#ifdef CONFIG_LOCK_KERNEL + /* kernel_locked is 1 for !CONFIG_LOCK_KERNEL */ + WARN_ON(kernel_locked()); +#endif + lock_kernel(); +} +static inline void tty_unlock(void) __releases(kernel_lock) +{ + unlock_kernel(); +} +#define tty_locked() (kernel_locked()) + #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */ #endif /* LINUX_26_36_COMPAT_H */ -- 2.30.2