X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fx86_64%2Fkernel%2Fearly_printk.c;h=aa50e298a99f640d2ce5eccf8caa582f5f74becd;hb=refs%2Fheads%2Fvserver;hp=140051e07fa64c7f07e2fd8b5e099ceaf15c3860;hpb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;p=linux-2.6.git diff --git a/arch/x86_64/kernel/early_printk.c b/arch/x86_64/kernel/early_printk.c index 140051e07..aa50e298a 100644 --- a/arch/x86_64/kernel/early_printk.c +++ b/arch/x86_64/kernel/early_printk.c @@ -20,6 +20,7 @@ static int max_ypos = 25, max_xpos = 80; static int current_ypos = 25, current_xpos = 0; +#ifndef CONFIG_XEN static void early_vga_write(struct console *con, const char *str, unsigned n) { char c; @@ -149,6 +150,39 @@ static __init void early_serial_init(char *s) outb(c & ~DLAB, early_serial_base + LCR); } +#else /* CONFIG_XEN */ + +#undef SCREEN_INFO +#define SCREEN_INFO screen_info +extern struct screen_info screen_info; + +static void +early_serial_write(struct console *con, const char *s, unsigned count) +{ + int n; + + while (count > 0) { + n = HYPERVISOR_console_io(CONSOLEIO_write, count, (char *)s); + if (n <= 0) + break; + count -= n; + s += n; + } +} + +static __init void early_serial_init(char *s) +{ + current_xpos = 0; +} + +/* + * No early VGA console on Xen, as we do not have convenient ISA-space + * mappings. Someone should fix this for domain 0. For now, use fake serial. + */ +#define early_vga_console early_serial_console + +#endif + static struct console early_serial_console = { .name = "earlyser", .write = early_serial_write, @@ -215,20 +249,16 @@ void early_printk(const char *fmt, ...) static int __initdata keep_early; -int __init setup_early_printk(char *opt) +static int __init setup_early_printk(char *buf) { - char *space; - char buf[256]; + if (!buf) + return 0; if (early_console_initialized) - return 1; - - strlcpy(buf,opt,sizeof(buf)); - space = strchr(buf, ' '); - if (space) - *space = 0; + return 0; + early_console_initialized = 1; - if (strstr(buf,"keep")) + if (strstr(buf, "keep")) keep_early = 1; if (!strncmp(buf, "serial", 6)) { @@ -248,11 +278,12 @@ int __init setup_early_printk(char *opt) early_console = &simnow_console; keep_early = 1; } - early_console_initialized = 1; register_console(early_console); return 0; } +early_param("earlyprintk", setup_early_printk); + void __init disable_early_printk(void) { if (!early_console_initialized || !early_console) @@ -266,4 +297,3 @@ void __init disable_early_printk(void) } } -__setup("earlyprintk=", setup_early_printk);