diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2014-09-10 15:06:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-24 00:19:35 -0400 |
commit | 136d5258b2bc4ffae99cb69874a76624c26fbfad (patch) | |
tree | 1699143576355e462091a5701b2814dc1d2d1d71 /drivers/tty/tty_io.c | |
parent | c545b66c6922b002b5fe224a6eaec58c913650b5 (diff) |
tty: Move and rename send_prio_char() as tty_send_xchar()
Relocate the file-scope function, send_prio_char(), as a global
helper tty_send_xchar(). Remove the global declarations for
tty_write_lock()/tty_write_unlock(), as these are file-scope only now.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r-- | drivers/tty/tty_io.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index c249ff1d51ce..2f6f9b5e4891 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
@@ -1023,14 +1023,14 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count, | |||
1023 | return i; | 1023 | return i; |
1024 | } | 1024 | } |
1025 | 1025 | ||
1026 | void tty_write_unlock(struct tty_struct *tty) | 1026 | static void tty_write_unlock(struct tty_struct *tty) |
1027 | __releases(&tty->atomic_write_lock) | 1027 | __releases(&tty->atomic_write_lock) |
1028 | { | 1028 | { |
1029 | mutex_unlock(&tty->atomic_write_lock); | 1029 | mutex_unlock(&tty->atomic_write_lock); |
1030 | wake_up_interruptible_poll(&tty->write_wait, POLLOUT); | 1030 | wake_up_interruptible_poll(&tty->write_wait, POLLOUT); |
1031 | } | 1031 | } |
1032 | 1032 | ||
1033 | int tty_write_lock(struct tty_struct *tty, int ndelay) | 1033 | static int tty_write_lock(struct tty_struct *tty, int ndelay) |
1034 | __acquires(&tty->atomic_write_lock) | 1034 | __acquires(&tty->atomic_write_lock) |
1035 | { | 1035 | { |
1036 | if (!mutex_trylock(&tty->atomic_write_lock)) { | 1036 | if (!mutex_trylock(&tty->atomic_write_lock)) { |
@@ -1217,6 +1217,35 @@ ssize_t redirected_tty_write(struct file *file, const char __user *buf, | |||
1217 | return tty_write(file, buf, count, ppos); | 1217 | return tty_write(file, buf, count, ppos); |
1218 | } | 1218 | } |
1219 | 1219 | ||
1220 | /** | ||
1221 | * tty_send_xchar - send priority character | ||
1222 | * | ||
1223 | * Send a high priority character to the tty even if stopped | ||
1224 | * | ||
1225 | * Locking: none for xchar method, write ordering for write method. | ||
1226 | */ | ||
1227 | |||
1228 | int tty_send_xchar(struct tty_struct *tty, char ch) | ||
1229 | { | ||
1230 | int was_stopped = tty->stopped; | ||
1231 | |||
1232 | if (tty->ops->send_xchar) { | ||
1233 | tty->ops->send_xchar(tty, ch); | ||
1234 | return 0; | ||
1235 | } | ||
1236 | |||
1237 | if (tty_write_lock(tty, 0) < 0) | ||
1238 | return -ERESTARTSYS; | ||
1239 | |||
1240 | if (was_stopped) | ||
1241 | start_tty(tty); | ||
1242 | tty->ops->write(tty, &ch, 1); | ||
1243 | if (was_stopped) | ||
1244 | stop_tty(tty); | ||
1245 | tty_write_unlock(tty); | ||
1246 | return 0; | ||
1247 | } | ||
1248 | |||
1220 | static char ptychar[] = "pqrstuvwxyzabcde"; | 1249 | static char ptychar[] = "pqrstuvwxyzabcde"; |
1221 | 1250 | ||
1222 | /** | 1251 | /** |