[PATCH RFC 06/13] xen: Dom0 console fixes
Roger Pau Monne
roger.pau at citrix.com
Tue Dec 24 11:22:41 UTC 2013
Minor fixes and workarounds to make the Xen Dom0 console work.
---
sys/dev/xen/console/xencons_ring.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/sys/dev/xen/console/xencons_ring.c b/sys/dev/xen/console/xencons_ring.c
index d826363..ea97f7b 100644
--- a/sys/dev/xen/console/xencons_ring.c
+++ b/sys/dev/xen/console/xencons_ring.c
@@ -48,6 +48,9 @@ xencons_has_input(void)
{
struct xencons_interface *intf;
+ if (xen_initial_domain())
+ return 1;
+
intf = xencons_interface();
return (intf->in_cons != intf->in_prod);
@@ -97,6 +100,19 @@ xencons_handle_input(void *unused)
XENCONS_RING_IDX cons, prod;
CN_LOCK(cn_mtx);
+
+ if (xen_initial_domain()) {
+ /* XXX: read from console */
+ static char rbuf[16];
+ int l;
+
+ while ((l = HYPERVISOR_console_io(CONSOLEIO_read, 16, rbuf)) > 0)
+ xencons_rx(rbuf, l);
+
+ CN_UNLOCK(cn_mtx);
+ return;
+ }
+
intf = xencons_interface();
cons = intf->in_cons;
--
1.7.7.5 (Apple Git-26)
More information about the freebsd-current
mailing list