public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/hvc: Fix polling mode to work with kdb/kgdb
@ 2012-06-07 13:30 Ben Guthro
  2012-06-07 16:40 ` [Xen-devel] " Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 8+ messages in thread
From: Ben Guthro @ 2012-06-07 13:30 UTC (permalink / raw)
  To: linux-kernel, xen-devel; +Cc: Konrad Rzeszutek Wilk

Fix the polling section of the hvc driver to use the global "last_hvc"
variable, rather than the ttys.

With this change debugging a xen dom0 kernel is possible via the
following kernel parameter:
kgdboc=hvc0

Signed-off-by: Ben Guthro <Benjamin.Guthro@citrix.com>


diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
index 2d691eb..3750e74 100644
--- a/drivers/tty/hvc/hvc_console.c
+++ b/drivers/tty/hvc/hvc_console.c
@@ -766,12 +766,10 @@ int hvc_poll_init(struct tty_driver *driver, int
line, char *options)

 static int hvc_poll_get_char(struct tty_driver *driver, int line)
 {
-       struct tty_struct *tty = driver->ttys[0];
-       struct hvc_struct *hp = tty->driver_data;
        int n;
        char ch;

-       n = hp->ops->get_chars(hp->vtermno, &ch, 1);
+       n = cons_ops[last_hvc]->get_chars(vtermnos[last_hvc], &ch, 1);

        if (n == 0)
                return NO_POLL_CHAR;
@@ -781,12 +779,10 @@ static int hvc_poll_get_char(struct tty_driver
*driver, int line)

 static void hvc_poll_put_char(struct tty_driver *driver, int line, char ch)
 {
-       struct tty_struct *tty = driver->ttys[0];
-       struct hvc_struct *hp = tty->driver_data;
        int n;

        do {
-               n = hp->ops->put_chars(hp->vtermno, &ch, 1);
+               n = cons_ops[last_hvc]->put_chars(vtermnos[last_hvc], &ch, 1);
        } while (n <= 0);
 }
 #endif

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-06-08 13:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-07 13:30 [PATCH] xen/hvc: Fix polling mode to work with kdb/kgdb Ben Guthro
2012-06-07 16:40 ` [Xen-devel] " Konrad Rzeszutek Wilk
2012-06-07 17:34   ` Ben Guthro
2012-06-07 17:48     ` Konrad Rzeszutek Wilk
2012-06-07 18:03       ` Ben Guthro
2012-06-07 18:01         ` Konrad Rzeszutek Wilk
2012-06-07 20:07           ` Ben Guthro
2012-06-08 13:13             ` Ben Guthro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox