summaryrefslogtreecommitdiffstats
path: root/drivers/char/hvc_console.h
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2008-10-14 05:02:09 +0000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-22 11:00:25 +1100
commitfebde3711992a64ea83a47a719f68a90c4b0927a (patch)
tree27f975fe9b3bd3b99a1a7043c34cf32176b7067d /drivers/char/hvc_console.h
parent3feebbb5492e9e463467cefb633e23a3dfcec132 (diff)
downloadblackbird-op-linux-febde3711992a64ea83a47a719f68a90c4b0927a.tar.gz
blackbird-op-linux-febde3711992a64ea83a47a719f68a90c4b0927a.zip
hvc_console: Add support for tty window resizing
The patch provides the hvc_resize() function to update the terminal window dimensions (struct winsize) for a specified hvc console. The function stores the new window size and schedules a function that finally updates the tty winsize and signals the change to user space (SIGWINCH). Because the winsize update must acquire a mutex and might sleep, the function is scheduled instead of being called from hvc_poll() or khvcd. This patch uses the tty_do_resize() routine from the tty layer. A pending resize work is canceled in hvc_close() and hvc_hangup(). Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/char/hvc_console.h')
-rw-r--r--drivers/char/hvc_console.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/char/hvc_console.h b/drivers/char/hvc_console.h
index ec0e9bb0e5e6..e3359f3c9b2a 100644
--- a/drivers/char/hvc_console.h
+++ b/drivers/char/hvc_console.h
@@ -27,6 +27,7 @@
#ifndef HVC_CONSOLE_H
#define HVC_CONSOLE_H
#include <linux/kref.h>
+#include <linux/tty.h>
/*
* This is the max number of console adapters that can/will be found as
@@ -56,6 +57,8 @@ struct hvc_struct {
struct hv_ops *ops;
int irq_requested;
int data;
+ struct winsize ws;
+ struct work_struct tty_resize;
struct list_head next;
struct kref kref; /* ref count & hvc_struct lifetime */
};
@@ -84,6 +87,9 @@ extern int __devexit hvc_remove(struct hvc_struct *hp);
int hvc_poll(struct hvc_struct *hp);
void hvc_kick(void);
+/* Resize hvc tty terminal window */
+extern void hvc_resize(struct hvc_struct *hp, struct winsize ws);
+
/* default notifier for irq based notification */
extern int notifier_add_irq(struct hvc_struct *hp, int data);
extern void notifier_del_irq(struct hvc_struct *hp, int data);
OpenPOWER on IntegriCloud