x86_64: early_print kernel console should send CRLF not LFCR
[sfrench/cifs-2.6.git] / arch / x86_64 / kernel / early_printk.c
index 47b6d90349da905f226709aaf29c9ff48e501741..296d2b0c5d886cf8e79e990cda8baca95604df68 100644 (file)
 
 #ifdef __i386__
 #include <asm/setup.h>
-#define VGABASE                (__ISA_IO_base + 0xb8000)
 #else
 #include <asm/bootsetup.h>
-#define VGABASE                ((void __iomem *)0xffffffff800b8000UL)
 #endif
+#define VGABASE                (__ISA_IO_base + 0xb8000)
 
 static int max_ypos = 25, max_xpos = 80;
 static int current_ypos = 25, current_xpos = 0;
@@ -92,9 +91,9 @@ static int early_serial_putc(unsigned char ch)
 static void early_serial_write(struct console *con, const char *s, unsigned n)
 {
        while (*s && n-- > 0) {
-               early_serial_putc(*s);
                if (*s == '\n')
                        early_serial_putc('\r');
+               early_serial_putc(*s);
                s++;
        }
 }
@@ -176,7 +175,7 @@ static noinline long simnow(long cmd, long a, long b, long c)
        return ret;
 }
 
-void __init simnow_init(char *str)
+static void __init simnow_init(char *str)
 {
        char *fn = "klog";
        if (*str == '=')
@@ -244,22 +243,12 @@ static int __init setup_early_printk(char *buf)
                early_console = &simnow_console;
                keep_early = 1;
        }
+
+       if (keep_early)
+               early_console->flags &= ~CON_BOOT;
+       else
+               early_console->flags |= CON_BOOT;
        register_console(early_console);
        return 0;
 }
-
 early_param("earlyprintk", setup_early_printk);
-
-void __init disable_early_printk(void)
-{
-       if (!early_console_initialized || !early_console)
-               return;
-       if (!keep_early) {
-               printk("disabling early console\n");
-               unregister_console(early_console);
-               early_console_initialized = 0;
-       } else {
-               printk("keeping early console\n");
-       }
-}
-