diff options
Diffstat (limited to 'drivers/tty/hvc/hvc_console.h')
-rw-r--r-- | drivers/tty/hvc/hvc_console.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/tty/hvc/hvc_console.h b/drivers/tty/hvc/hvc_console.h index 18d005814e4b..2c32ab67b68d 100644 --- a/drivers/tty/hvc/hvc_console.h +++ b/drivers/tty/hvc/hvc_console.h @@ -32,12 +32,21 @@ */ #define HVC_ALLOC_TTY_ADAPTERS 8 +/* + * These sizes are most efficient for vio, because they are the + * native transfer size. We could make them selectable in the + * future to better deal with backends that want other buffer sizes. + */ +#define N_OUTBUF 16 +#define N_INBUF 16 + +#define __ALIGNED__ __attribute__((__aligned__(L1_CACHE_BYTES))) + struct hvc_struct { struct tty_port port; spinlock_t lock; int index; int do_wakeup; - char *outbuf; int outbuf_size; int n_outbuf; uint32_t vtermno; @@ -48,6 +57,16 @@ struct hvc_struct { struct work_struct tty_resize; struct list_head next; unsigned long flags; + + /* + * the buf and its lock are used in hvc console api for putting chars, + * and also used in hvc_poll_put_char() for putting single char. + */ + spinlock_t cons_outbuf_lock; + char cons_outbuf[N_OUTBUF] __ALIGNED__; + + /* the buf is used for putting chars to tty */ + char outbuf[] __ALIGNED__; }; /* implemented by a low level driver */ |