[PATCH] initialize end of memory variables as early as possible
[pandora-kernel.git] / arch / x86_64 / kernel / setup.c
index 0925518..ddc3b2d 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
-#include <linux/tty.h>
+#include <linux/screen_info.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
 #include <linux/init.h>
@@ -340,10 +340,8 @@ static __init void parse_cmdline_early (char ** cmdline_p)
                else if (fullarg(from, "acpi=strict")) {
                        acpi_strict = 1;
                }
-#ifdef CONFIG_X86_IO_APIC
                else if (fullarg(from, "acpi_skip_timer_override"))
                        acpi_skip_timer_override = 1;
-#endif
 #endif
 
                if (fullarg(from, "disable_timer_pin_1"))
@@ -521,8 +519,6 @@ static void discover_ebda(void)
 
 void __init setup_arch(char **cmdline_p)
 {
-       unsigned long kernel_end;
-
        ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
        screen_info = SCREEN_INFO;
        edid_info = EDID_INFO;
@@ -558,7 +554,7 @@ void __init setup_arch(char **cmdline_p)
         * we are rounding upwards:
         */
        end_pfn = e820_end_of_ram();
-       num_physpages = end_pfn;                /* for pfn_valid */
+       num_physpages = end_pfn;
 
        check_efer();
 
@@ -578,6 +574,11 @@ void __init setup_arch(char **cmdline_p)
        acpi_boot_table_init();
 #endif
 
+       /* How many end-of-memory variables you have, grandma! */
+       max_low_pfn = end_pfn;
+       max_pfn = end_pfn;
+       high_memory = (void *)__va(end_pfn * PAGE_SIZE - 1) + 1;
+
 #ifdef CONFIG_ACPI_NUMA
        /*
         * Parse SRAT to discover nodes.
@@ -596,8 +597,8 @@ void __init setup_arch(char **cmdline_p)
                                (table_end - table_start) << PAGE_SHIFT);
 
        /* reserve kernel */
-       kernel_end = round_up(__pa_symbol(&_end),PAGE_SIZE);
-       reserve_bootmem_generic(HIGH_MEMORY, kernel_end - HIGH_MEMORY);
+       reserve_bootmem_generic(__pa_symbol(&_text),
+                               __pa_symbol(&_end) - __pa_symbol(&_text));
 
        /*
         * reserve physical page 0 - it's a special BIOS page on many boxes,
@@ -627,12 +628,10 @@ void __init setup_arch(char **cmdline_p)
         */
        acpi_reserve_bootmem();
 #endif
-#ifdef CONFIG_X86_LOCAL_APIC
        /*
         * Find and reserve possible boot-time SMP configuration:
         */
        find_smp_config();
-#endif
 #ifdef CONFIG_BLK_DEV_INITRD
        if (LOADER_TYPE && INITRD_START) {
                if (INITRD_START + INITRD_SIZE <= (end_pfn << PAGE_SHIFT)) {
@@ -659,7 +658,7 @@ void __init setup_arch(char **cmdline_p)
 
        paging_init();
 
-       check_ioapic();
+       early_quirks();
 
        /*
         * set this early, so we dont allocate cpu0
@@ -676,14 +675,12 @@ void __init setup_arch(char **cmdline_p)
 
        init_cpu_to_node();
 
-#ifdef CONFIG_X86_LOCAL_APIC
        /*
         * get boot-time SMP configuration:
         */
        if (smp_found_config)
                get_smp_config();
        init_apic_mappings();
-#endif
 
        /*
         * Request address space for all standard RAM and ROM resources