Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99539
b: refs/heads/master
c: 9e124fe
h: refs/heads/master
i:
  99537: 9d9f893
  99535: 6e15d1b
v: v3
  • Loading branch information
Markus Armbruster authored and Thomas Gleixner committed May 27, 2008
1 parent a9af52b commit 165e708
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a15af1c9ea2750a9ff01e51615c45950bad8221b
refs/heads/master: 9e124fe16ff24746d6de5a2ad685266d7bce0e08
4 changes: 3 additions & 1 deletion trunk/arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -1256,8 +1256,10 @@ asmlinkage void __init xen_start_kernel(void)
? __pa(xen_start_info->mod_start) : 0;
boot_params.hdr.ramdisk_size = xen_start_info->mod_len;

if (!is_initial_xendomain())
if (!is_initial_xendomain()) {
add_preferred_console("tty", 0, NULL);
add_preferred_console("hvc", 0, NULL);
}

/* Start the world */
start_kernel();
Expand Down
25 changes: 25 additions & 0 deletions trunk/drivers/video/xen-fbfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* frame buffer.
*/

#include <linux/console.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/fb.h>
Expand Down Expand Up @@ -48,6 +49,7 @@ struct xenfb_info {

static u32 xenfb_mem_len = XENFB_WIDTH * XENFB_HEIGHT * XENFB_DEPTH / 8;

static void xenfb_make_preferred_console(void);
static int xenfb_remove(struct xenbus_device *);
static void xenfb_init_shared_page(struct xenfb_info *);
static int xenfb_connect_backend(struct xenbus_device *, struct xenfb_info *);
Expand Down Expand Up @@ -348,6 +350,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
if (ret < 0)
goto error;

xenfb_make_preferred_console();
return 0;

error_nomem:
Expand All @@ -358,6 +361,28 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
return ret;
}

static __devinit void
xenfb_make_preferred_console(void)
{
struct console *c;

if (console_set_on_cmdline)
return;

acquire_console_sem();
for (c = console_drivers; c; c = c->next) {
if (!strcmp(c->name, "tty") && c->index == 0)
break;
}
release_console_sem();
if (c) {
unregister_console(c);
c->flags |= CON_CONSDEV;
c->flags &= ~CON_PRINTBUFFER; /* don't print again */
register_console(c);
}
}

static int xenfb_resume(struct xenbus_device *dev)
{
struct xenfb_info *info = dev->dev.driver_data;
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ struct console {
struct console *next;
};

extern int console_set_on_cmdline;

extern int add_preferred_console(char *name, int idx, char *options);
extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options);
extern void register_console(struct console *);
Expand Down
3 changes: 3 additions & 0 deletions trunk/kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ struct console_cmdline
static struct console_cmdline console_cmdline[MAX_CMDLINECONSOLES];
static int selected_console = -1;
static int preferred_console = -1;
int console_set_on_cmdline;
EXPORT_SYMBOL(console_set_on_cmdline);

/* Flag: console code may call schedule() */
static int console_may_schedule;
Expand Down Expand Up @@ -890,6 +892,7 @@ static int __init console_setup(char *str)
*s = 0;

__add_preferred_console(buf, idx, options, brl_options);
console_set_on_cmdline = 1;
return 1;
}
__setup("console=", console_setup);
Expand Down

0 comments on commit 165e708

Please sign in to comment.