summaryrefslogtreecommitdiff
path: root/include/linux/tty.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h29
1 files changed, 22 insertions, 7 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 97d660e..64f8646 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -180,6 +180,7 @@ struct tty_port_operations {
IFF the port was initialized. Do not use to free resources. Called
under the port mutex to serialize against activate/shutdowns */
void (*shutdown)(struct tty_port *port);
+ void (*drop)(struct tty_port *port);
/* Called under the port mutex from tty_port_open, serialized using
the port mutex */
/* FIXME: long term getting the tty argument *out* of this would be
@@ -671,17 +672,31 @@ static inline void tty_wait_until_sent_from_close(struct tty_struct *tty,
#define wait_event_interruptible_tty(tty, wq, condition) \
({ \
int __ret = 0; \
- if (!(condition)) \
- __ret = __wait_event_interruptible_tty(tty, wq, \
- condition); \
+ if (!(condition)) { \
+ __wait_event_interruptible_tty(tty, wq, condition, __ret); \
+ } \
__ret; \
})
-#define __wait_event_interruptible_tty(tty, wq, condition) \
- ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0, \
- tty_unlock(tty); \
+#define __wait_event_interruptible_tty(tty, wq, condition, ret) \
+do { \
+ DEFINE_WAIT(__wait); \
+ \
+ for (;;) { \
+ prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \
+ if (condition) \
+ break; \
+ if (!signal_pending(current)) { \
+ tty_unlock(tty); \
schedule(); \
- tty_lock(tty))
+ tty_lock(tty); \
+ continue; \
+ } \
+ ret = -ERESTARTSYS; \
+ break; \
+ } \
+ finish_wait(&wq, &__wait); \
+} while (0)
#ifdef CONFIG_PROC_FS
extern void proc_tty_register_driver(struct tty_driver *);