aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/xen/enlighten.c4
-rw-r--r--drivers/video/xen-fbfront.c25
-rw-r--r--include/linux/console.h2
-rw-r--r--kernel/printk.c3
4 files changed, 33 insertions, 1 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 1b4b5fa498b3..6cfb708408e9 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1256,8 +1256,10 @@ asmlinkage void __init xen_start_kernel(void)
1256 ? __pa(xen_start_info->mod_start) : 0; 1256 ? __pa(xen_start_info->mod_start) : 0;
1257 boot_params.hdr.ramdisk_size = xen_start_info->mod_len; 1257 boot_params.hdr.ramdisk_size = xen_start_info->mod_len;
1258 1258
1259 if (!is_initial_xendomain()) 1259 if (!is_initial_xendomain()) {
1260 add_preferred_console("tty", 0, NULL);
1260 add_preferred_console("hvc", 0, NULL); 1261 add_preferred_console("hvc", 0, NULL);
1262 }
1261 1263
1262 /* Start the world */ 1264 /* Start the world */
1263 start_kernel(); 1265 start_kernel();
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index 619a6f8d65a2..4e10876e62fc 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -18,6 +18,7 @@
18 * frame buffer. 18 * frame buffer.
19 */ 19 */
20 20
21#include <linux/console.h>
21#include <linux/kernel.h> 22#include <linux/kernel.h>
22#include <linux/errno.h> 23#include <linux/errno.h>
23#include <linux/fb.h> 24#include <linux/fb.h>
@@ -48,6 +49,7 @@ struct xenfb_info {
48 49
49static u32 xenfb_mem_len = XENFB_WIDTH * XENFB_HEIGHT * XENFB_DEPTH / 8; 50static u32 xenfb_mem_len = XENFB_WIDTH * XENFB_HEIGHT * XENFB_DEPTH / 8;
50 51
52static void xenfb_make_preferred_console(void);
51static int xenfb_remove(struct xenbus_device *); 53static int xenfb_remove(struct xenbus_device *);
52static void xenfb_init_shared_page(struct xenfb_info *); 54static void xenfb_init_shared_page(struct xenfb_info *);
53static int xenfb_connect_backend(struct xenbus_device *, struct xenfb_info *); 55static int xenfb_connect_backend(struct xenbus_device *, struct xenfb_info *);
@@ -348,6 +350,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
348 if (ret < 0) 350 if (ret < 0)
349 goto error; 351 goto error;
350 352
353 xenfb_make_preferred_console();
351 return 0; 354 return 0;
352 355
353 error_nomem: 356 error_nomem:
@@ -358,6 +361,28 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
358 return ret; 361 return ret;
359} 362}
360 363
364static __devinit void
365xenfb_make_preferred_console(void)
366{
367 struct console *c;
368
369 if (console_set_on_cmdline)
370 return;
371
372 acquire_console_sem();
373 for (c = console_drivers; c; c = c->next) {
374 if (!strcmp(c->name, "tty") && c->index == 0)
375 break;
376 }
377 release_console_sem();
378 if (c) {
379 unregister_console(c);
380 c->flags |= CON_CONSDEV;
381 c->flags &= ~CON_PRINTBUFFER; /* don't print again */
382 register_console(c);
383 }
384}
385
361static int xenfb_resume(struct xenbus_device *dev) 386static int xenfb_resume(struct xenbus_device *dev)
362{ 387{
363 struct xenfb_info *info = dev->dev.driver_data; 388 struct xenfb_info *info = dev->dev.driver_data;
diff --git a/include/linux/console.h b/include/linux/console.h
index a4f27fbdf549..248e6e3b9b73 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -108,6 +108,8 @@ struct console {
108 struct console *next; 108 struct console *next;
109}; 109};
110 110
111extern int console_set_on_cmdline;
112
111extern int add_preferred_console(char *name, int idx, char *options); 113extern int add_preferred_console(char *name, int idx, char *options);
112extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options); 114extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options);
113extern void register_console(struct console *); 115extern void register_console(struct console *);
diff --git a/kernel/printk.c b/kernel/printk.c
index 8fb01c32aa3b..028ed75d4864 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -121,6 +121,8 @@ struct console_cmdline
121static struct console_cmdline console_cmdline[MAX_CMDLINECONSOLES]; 121static struct console_cmdline console_cmdline[MAX_CMDLINECONSOLES];
122static int selected_console = -1; 122static int selected_console = -1;
123static int preferred_console = -1; 123static int preferred_console = -1;
124int console_set_on_cmdline;
125EXPORT_SYMBOL(console_set_on_cmdline);
124 126
125/* Flag: console code may call schedule() */ 127/* Flag: console code may call schedule() */
126static int console_may_schedule; 128static int console_may_schedule;
@@ -890,6 +892,7 @@ static int __init console_setup(char *str)
890 *s = 0; 892 *s = 0;
891 893
892 __add_preferred_console(buf, idx, options, brl_options); 894 __add_preferred_console(buf, idx, options, brl_options);
895 console_set_on_cmdline = 1;
893 return 1; 896 return 1;
894} 897}
895__setup("console=", console_setup); 898__setup("console=", console_setup);