Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / init / main.c
index 495a5bc..9b807dd 100644 (file)
 
 #define __KERNEL_SYSCALLS__
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/proc_fs.h>
-#include <linux/devfs_fs_kernel.h>
 #include <linux/kernel.h>
 #include <linux/syscalls.h>
 #include <linux/string.h>
 #include <linux/cpu.h>
 #include <linux/cpuset.h>
 #include <linux/efi.h>
+#include <linux/taskstats_kern.h>
+#include <linux/delayacct.h>
 #include <linux/unistd.h>
 #include <linux/rmap.h>
 #include <linux/mempolicy.h>
 #include <linux/key.h>
+#include <linux/unwind.h>
+#include <linux/buffer_head.h>
+#include <linux/debug_locks.h>
+#include <linux/lockdep.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
@@ -79,7 +83,6 @@ extern void mca_init(void);
 extern void sbus_init(void);
 extern void sysctl_init(void);
 extern void signals_init(void);
-extern void buffer_init(void);
 extern void pidhash_init(void);
 extern void pidmap_init(void);
 extern void prio_tree_init(void);
@@ -349,6 +352,10 @@ static void __init setup_per_cpu_areas(void)
 }
 #endif /* !__GENERIC_PER_CPU */
 
+#include <linux/ext3_fs_i.h>
+#include <linux/skbuff.h>
+#include <linux/sched.h>
+
 /* Called by boot processor to activate the rest. */
 static void __init smp_init(void)
 {
@@ -370,6 +377,15 @@ static void __init smp_init(void)
 
        smp_commence();
 #endif
+
+       printk(KERN_DEBUG "sizeof(vma)=%u bytes\n", (unsigned int) sizeof(struct vm_area_struct));
+       printk(KERN_DEBUG "sizeof(page)=%u bytes\n", (unsigned int) sizeof(struct page));
+       printk(KERN_DEBUG "sizeof(inode)=%u bytes\n", (unsigned int) sizeof(struct inode));
+       printk(KERN_DEBUG "sizeof(dentry)=%u bytes\n", (unsigned int) sizeof(struct dentry));
+       printk(KERN_DEBUG "sizeof(ext3inode)=%u bytes\n", (unsigned int) sizeof(struct ext3_inode_info));
+       printk(KERN_DEBUG "sizeof(buffer_head)=%u bytes\n", (unsigned int) sizeof(struct buffer_head));
+       printk(KERN_DEBUG "sizeof(skbuff)=%u bytes\n", (unsigned int) sizeof(struct sk_buff));
+       printk(KERN_DEBUG "sizeof(task_struct)=%u bytes\n", (unsigned int) sizeof(struct task_struct));
 }
 
 #endif
@@ -446,10 +462,28 @@ 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:
+        */
+       unwind_init();
+       lockdep_init();
+
+       local_irq_disable();
+       early_boot_irqs_off();
+       early_init_irq_lock_class();
+
 /*
  * Interrupts are still disabled. Do necessary setups, then
  * enable them
@@ -489,7 +523,13 @@ asmlinkage void __init start_kernel(void)
        init_timers();
        hrtimers_init();
        softirq_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
@@ -499,8 +539,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) {
@@ -541,6 +589,8 @@ asmlinkage void __init start_kernel(void)
        proc_root_init();
 #endif
        cpuset_init();
+       taskstats_init_early();
+       delayacct_init();
 
        check_bugs();