aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tty_flip.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/tty_flip.h')
-rw-r--r--include/linux/tty_flip.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index abe9bfcf226c..be1400e82482 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -1,25 +1,33 @@
1#ifndef _LINUX_TTY_FLIP_H 1#ifndef _LINUX_TTY_FLIP_H
2#define _LINUX_TTY_FLIP_H 2#define _LINUX_TTY_FLIP_H
3 3
4extern int tty_buffer_request_room(struct tty_struct *tty, size_t size);
5extern int tty_insert_flip_string(struct tty_struct *tty, unsigned char *chars, size_t size);
6extern int tty_insert_flip_string_flags(struct tty_struct *tty, unsigned char *chars, char *flags, size_t size);
7extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size);
8extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size);
9
4#ifdef INCLUDE_INLINE_FUNCS 10#ifdef INCLUDE_INLINE_FUNCS
5#define _INLINE_ extern 11#define _INLINE_ extern
6#else 12#else
7#define _INLINE_ static __inline__ 13#define _INLINE_ static __inline__
8#endif 14#endif
9 15
10_INLINE_ void tty_insert_flip_char(struct tty_struct *tty, 16_INLINE_ int tty_insert_flip_char(struct tty_struct *tty,
11 unsigned char ch, char flag) 17 unsigned char ch, char flag)
12{ 18{
13 if (tty->flip.count < TTY_FLIPBUF_SIZE) { 19 struct tty_buffer *tb = tty->buf.tail;
14 tty->flip.count++; 20 if (tb && tb->used < tb->size) {
15 *tty->flip.flag_buf_ptr++ = flag; 21 tb->flag_buf_ptr[tb->used] = flag;
16 *tty->flip.char_buf_ptr++ = ch; 22 tb->char_buf_ptr[tb->used++] = ch;
23 return 1;
17 } 24 }
25 return tty_insert_flip_string_flags(tty, &ch, &flag, 1);
18} 26}
19 27
20_INLINE_ void tty_schedule_flip(struct tty_struct *tty) 28_INLINE_ void tty_schedule_flip(struct tty_struct *tty)
21{ 29{
22 schedule_delayed_work(&tty->flip.work, 1); 30 schedule_delayed_work(&tty->buf.work, 1);
23} 31}
24 32
25#undef _INLINE_ 33#undef _INLINE_