aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/tty/hvc/hvc_xen.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index 68b8ec886bec..f34dec1d588a 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -246,6 +246,18 @@ err:
246 return -ENODEV; 246 return -ENODEV;
247} 247}
248 248
249static int xencons_info_pv_init(struct xencons_info *info, int vtermno)
250{
251 info->evtchn = xen_start_info->console.domU.evtchn;
252 /* GFN == MFN for PV guest */
253 info->intf = gfn_to_virt(xen_start_info->console.domU.mfn);
254 info->vtermno = vtermno;
255
256 list_add_tail(&info->list, &xenconsoles);
257
258 return 0;
259}
260
249static int xen_pv_console_init(void) 261static int xen_pv_console_init(void)
250{ 262{
251 struct xencons_info *info; 263 struct xencons_info *info;
@@ -265,13 +277,8 @@ static int xen_pv_console_init(void)
265 /* already configured */ 277 /* already configured */
266 return 0; 278 return 0;
267 } 279 }
268 info->evtchn = xen_start_info->console.domU.evtchn;
269 /* GFN == MFN for PV guest */
270 info->intf = gfn_to_virt(xen_start_info->console.domU.mfn);
271 info->vtermno = HVC_COOKIE;
272
273 spin_lock(&xencons_lock); 280 spin_lock(&xencons_lock);
274 list_add_tail(&info->list, &xenconsoles); 281 xencons_info_pv_init(info, HVC_COOKIE);
275 spin_unlock(&xencons_lock); 282 spin_unlock(&xencons_lock);
276 283
277 return 0; 284 return 0;
@@ -599,6 +606,18 @@ static int xen_cons_init(void)
599console_initcall(xen_cons_init); 606console_initcall(xen_cons_init);
600 607
601#ifdef CONFIG_EARLY_PRINTK 608#ifdef CONFIG_EARLY_PRINTK
609static int __init xenboot_setup_console(struct console *console, char *string)
610{
611 static struct xencons_info xenboot;
612
613 if (xen_initial_domain())
614 return 0;
615 if (!xen_pv_domain())
616 return -ENODEV;
617
618 return xencons_info_pv_init(&xenboot, 0);
619}
620
602static void xenboot_write_console(struct console *console, const char *string, 621static void xenboot_write_console(struct console *console, const char *string,
603 unsigned len) 622 unsigned len)
604{ 623{
@@ -629,6 +648,7 @@ static void xenboot_write_console(struct console *console, const char *string,
629struct console xenboot_console = { 648struct console xenboot_console = {
630 .name = "xenboot", 649 .name = "xenboot",
631 .write = xenboot_write_console, 650 .write = xenboot_write_console,
651 .setup = xenboot_setup_console,
632 .flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME, 652 .flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME,
633 .index = -1, 653 .index = -1,
634}; 654};