VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / arch / ia64 / kernel / setup.c
index aa2cb4f..8aff39d 100644 (file)
@@ -47,6 +47,7 @@
 #include <asm/sal.h>
 #include <asm/sections.h>
 #include <asm/serial.h>
+#include <asm/setup.h>
 #include <asm/smp.h>
 #include <asm/system.h>
 #include <asm/unistd.h>
@@ -88,10 +89,6 @@ unsigned char aux_device_present = 0xaa;        /* XXX remove this when legacy I
 unsigned long ia64_max_iommu_merge_mask = ~0UL;
 EXPORT_SYMBOL(ia64_max_iommu_merge_mask);
 
-#define COMMAND_LINE_SIZE      512
-
-char saved_command_line[COMMAND_LINE_SIZE]; /* used in proc filesystem */
-
 /*
  * We use a special marker for the end of memory and it uses the extra (+1) slot
  */
@@ -280,6 +277,29 @@ setup_serial_legacy (void)
 }
 #endif
 
+/**
+ * early_console_setup - setup debugging console
+ *
+ * Consoles started here require little enough setup that we can start using
+ * them very early in the boot process, either right after the machine
+ * vector initialization, or even before if the drivers can detect their hw.
+ *
+ * Returns non-zero if a console couldn't be setup.
+ */
+static inline int __init
+early_console_setup (void)
+{
+#ifdef CONFIG_SERIAL_SGI_L1_CONSOLE
+       {
+               extern int sn_serial_console_early_setup(void);
+               if(!sn_serial_console_early_setup())
+                       return 0;
+       }
+#endif
+
+       return -1;
+}
+
 void __init
 setup_arch (char **cmdline_p)
 {
@@ -288,7 +308,7 @@ setup_arch (char **cmdline_p)
        ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist);
 
        *cmdline_p = __va(ia64_boot_param->command_line);
-       strlcpy(saved_command_line, *cmdline_p, sizeof(saved_command_line));
+       strlcpy(saved_command_line, *cmdline_p, COMMAND_LINE_SIZE);
 
        efi_init();
        io_port_init();
@@ -297,6 +317,12 @@ setup_arch (char **cmdline_p)
        machvec_init(acpi_get_sysname());
 #endif
 
+#ifdef CONFIG_SMP
+       /* If we register an early console, allow CPU 0 to printk */
+       if (!early_console_setup())
+               cpu_set(smp_processor_id(), cpu_online_map);
+#endif
+
 #ifdef CONFIG_ACPI_BOOT
        /* Initialize the ACPI boot-time table parser */
        acpi_table_init();
@@ -323,36 +349,36 @@ setup_arch (char **cmdline_p)
 #ifdef CONFIG_ACPI_BOOT
        acpi_boot_init();
 #endif
-#ifdef CONFIG_SERIAL_8250_CONSOLE
-#ifdef CONFIG_SERIAL_8250_HCDP
-       if (efi.hcdp) {
-               void setup_serial_hcdp(void *);
-               setup_serial_hcdp(efi.hcdp);
-       }
+#ifdef CONFIG_EFI_PCDP
+       efi_setup_pcdp_console(*cmdline_p);
 #endif
+#ifdef CONFIG_SERIAL_8250_CONSOLE
        if (!efi.hcdp)
                setup_serial_legacy();
 #endif
 
 #ifdef CONFIG_VT
+       if (!conswitchp) {
 # if defined(CONFIG_DUMMY_CONSOLE)
-       conswitchp = &dummy_con;
+               conswitchp = &dummy_con;
 # endif
 # if defined(CONFIG_VGA_CONSOLE)
-       /*
-        * Non-legacy systems may route legacy VGA MMIO range to system
-        * memory.  vga_con probes the MMIO hole, so memory looks like
-        * a VGA device to it.  The EFI memory map can tell us if it's
-        * memory so we can avoid this problem.
-        */
-       if (efi_mem_type(0xA0000) != EFI_CONVENTIONAL_MEMORY)
-               conswitchp = &vga_con;
+               /*
+                * Non-legacy systems may route legacy VGA MMIO range to system
+                * memory.  vga_con probes the MMIO hole, so memory looks like
+                * a VGA device to it.  The EFI memory map can tell us if it's
+                * memory so we can avoid this problem.
+                */
+               if (efi_mem_type(0xA0000) != EFI_CONVENTIONAL_MEMORY)
+                       conswitchp = &vga_con;
 # endif
+       }
 #endif
 
-       /* enable IA-64 Machine Check Abort Handling */
-       ia64_mca_init();
-
+       /* enable IA-64 Machine Check Abort Handling unless disabled */
+       if (!strstr(saved_command_line, "nomca"))
+               ia64_mca_init();
+       
        platform_setup(cmdline_p);
        paging_init();
 }