compat: backport tty_{lock,unlock,locked}
authorHauke Mehrtens <hauke@hauke-m.de>
Mon, 21 Feb 2011 22:32:23 +0000 (14:32 -0800)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 22 Feb 2011 20:53:26 +0000 (12:53 -0800)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
include/linux/compat-2.6.36.h

index 74d2309..0e3b774 100644 (file)
@@ -9,6 +9,7 @@
 #include <pcmcia/cistpl.h>
 #include <pcmcia/ds.h>
 #include <linux/pm_qos_params.h>
+#include <linux/smp_lock.h>
 
 #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 */