aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tty_ldisc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/tty_ldisc.h')
-rw-r--r--include/linux/tty_ldisc.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index 58390c73df8b..a1b048999821 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -100,6 +100,11 @@
100 * seek to perform this action quickly but should wait until 100 * seek to perform this action quickly but should wait until
101 * any pending driver I/O is completed. 101 * any pending driver I/O is completed.
102 * 102 *
103 * void (*fasync)(struct tty_struct *, int on)
104 *
105 * Notify line discipline when signal-driven I/O is enabled or
106 * disabled.
107 *
103 * void (*dcd_change)(struct tty_struct *tty, unsigned int status) 108 * void (*dcd_change)(struct tty_struct *tty, unsigned int status)
104 * 109 *
105 * Tells the discipline that the DCD pin has changed its status. 110 * Tells the discipline that the DCD pin has changed its status.
@@ -110,6 +115,52 @@
110#include <linux/wait.h> 115#include <linux/wait.h>
111#include <linux/wait.h> 116#include <linux/wait.h>
112 117
118
119/*
120 * the semaphore definition
121 */
122struct ld_semaphore {
123 long count;
124 raw_spinlock_t wait_lock;
125 unsigned int wait_readers;
126 struct list_head read_wait;
127 struct list_head write_wait;
128#ifdef CONFIG_DEBUG_LOCK_ALLOC
129 struct lockdep_map dep_map;
130#endif
131};
132
133extern void __init_ldsem(struct ld_semaphore *sem, const char *name,
134 struct lock_class_key *key);
135
136#define init_ldsem(sem) \
137do { \
138 static struct lock_class_key __key; \
139 \
140 __init_ldsem((sem), #sem, &__key); \
141} while (0)
142
143
144extern int ldsem_down_read(struct ld_semaphore *sem, long timeout);
145extern int ldsem_down_read_trylock(struct ld_semaphore *sem);
146extern int ldsem_down_write(struct ld_semaphore *sem, long timeout);
147extern int ldsem_down_write_trylock(struct ld_semaphore *sem);
148extern void ldsem_up_read(struct ld_semaphore *sem);
149extern void ldsem_up_write(struct ld_semaphore *sem);
150
151#ifdef CONFIG_DEBUG_LOCK_ALLOC
152extern int ldsem_down_read_nested(struct ld_semaphore *sem, int subclass,
153 long timeout);
154extern int ldsem_down_write_nested(struct ld_semaphore *sem, int subclass,
155 long timeout);
156#else
157# define ldsem_down_read_nested(sem, subclass, timeout) \
158 ldsem_down_read(sem, timeout)
159# define ldsem_down_write_nested(sem, subclass, timeout) \
160 ldsem_down_write(sem, timeout)
161#endif
162
163
113struct tty_ldisc_ops { 164struct tty_ldisc_ops {
114 int magic; 165 int magic;
115 char *name; 166 char *name;
@@ -143,6 +194,7 @@ struct tty_ldisc_ops {
143 char *fp, int count); 194 char *fp, int count);
144 void (*write_wakeup)(struct tty_struct *); 195 void (*write_wakeup)(struct tty_struct *);
145 void (*dcd_change)(struct tty_struct *, unsigned int); 196 void (*dcd_change)(struct tty_struct *, unsigned int);
197 void (*fasync)(struct tty_struct *tty, int on);
146 198
147 struct module *owner; 199 struct module *owner;
148 200