X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=init%2Fmain.c;h=8651a720a092c4ade7e530c01b57b040c3e52539;hb=a1073406a124c1d3b33a0f06bfb8078a9ddd1985;hp=bce0eb7f4f8fb50413a516b1a3bafbb8ae81b821;hpb=602cada851b28c5792339786efe872fbdc1f5d41;p=~andy%2Flinux diff --git a/init/main.c b/init/main.c index bce0eb7f4f8..8651a720a09 100644 --- a/init/main.c +++ b/init/main.c @@ -11,7 +11,6 @@ #define __KERNEL_SYSCALLS__ -#include #include #include #include @@ -42,12 +41,16 @@ #include #include #include +#include +#include #include #include #include #include #include #include +#include +#include #include #include @@ -446,10 +449,27 @@ static void __init boot_cpu_init(void) cpu_set(cpu, cpu_possible_map); } +void __init __attribute__((weak)) smp_setup_processor_id(void) +{ +} + asmlinkage void __init start_kernel(void) { char * command_line; extern struct kernel_param __start___param[], __stop___param[]; + + smp_setup_processor_id(); + + /* + * Need to run as early as possible, to initialize the + * lockdep hash: + */ + lockdep_init(); + + local_irq_disable(); + early_boot_irqs_off(); + early_init_irq_lock_class(); + /* * Interrupts are still disabled. Do necessary setups, then * enable them @@ -490,8 +510,13 @@ asmlinkage void __init start_kernel(void) init_timers(); hrtimers_init(); softirq_init(); - time_init(); timekeeping_init(); + time_init(); + profile_init(); + if (!irqs_disabled()) + printk("start_kernel(): bug: interrupts were enabled early\n"); + early_boot_irqs_on(); + local_irq_enable(); /* * HACK ALERT! This is early. We're enabling the console before @@ -501,8 +526,16 @@ asmlinkage void __init start_kernel(void) console_init(); if (panic_later) panic(panic_later, panic_param); - profile_init(); - local_irq_enable(); + + lockdep_info(); + + /* + * Need to run this when irqs are enabled, because it wants + * to self-test [hard/soft]-irqs on/off lock inversion bugs + * too: + */ + locking_selftest(); + #ifdef CONFIG_BLK_DEV_INITRD if (initrd_start && !initrd_below_start_ok && initrd_start < min_low_pfn << PAGE_SHIFT) { @@ -543,6 +576,8 @@ asmlinkage void __init start_kernel(void) proc_root_init(); #endif cpuset_init(); + taskstats_init_early(); + delayacct_init(); check_bugs();