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.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 812cdd8cff22..68392a4ca28a 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -12,7 +12,7 @@
#include <uapi/linux/tty.h>
#include <linux/rwsem.h>
#include <linux/llist.h>
-
+#include <linux/kthread.h>
/*
* Lock subclasses for tty locks
@@ -64,7 +64,7 @@ struct tty_buffer {
int read;
int flags;
/* Data points here */
- unsigned long data[0];
+ unsigned long data[];
};
/* Values for .flags field of tty_buffer */
@@ -82,7 +82,7 @@ static inline char *flag_buf_ptr(struct tty_buffer *b, int ofs)
struct tty_bufhead {
struct tty_buffer *head; /* Queue head */
- struct work_struct work;
+ struct kthread_work work;
struct mutex lock;
atomic_t priority;
struct tty_buffer sentinel;
@@ -240,6 +240,8 @@ struct tty_port {
based drain is needed else
set to size of fifo */
struct kref kref; /* Ref counter */
+ struct kthread_worker worker; /* worker thread */
+ struct task_struct *worker_thread; /* worker thread */
};
/*
@@ -280,6 +282,10 @@ struct tty_struct {
struct termiox *termiox; /* May be NULL for unsupported */
char name[64];
struct pid *pgrp; /* Protected by ctrl lock */
+ /*
+ * Writes protected by both ctrl lock and legacy mutex, readers must use
+ * at least one of them.
+ */
struct pid *session;
unsigned long flags;
int count;
@@ -580,6 +586,8 @@ static inline int tty_port_users(struct tty_port *port)
{
return port->count + port->blocked_open;
}
+extern int tty_port_set_policy(struct tty_port *port, int policy,
+ int sched_priority);
extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc);
extern int tty_unregister_ldisc(int disc);