X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=init%2Fmain.c;h=e8d080cab443750f7360d50bd32aa0c7644a6a4e;hb=e0863397cb8f3ede356ef2cb7dcdccc9956cdc6d;hp=80f09f31bfabf68c3d6b317c7f0470f14f8bfac7;hpb=c6799ade4ae04b53a5f677e5289116155ff01574;p=powerpc.git diff --git a/init/main.c b/init/main.c index 80f09f31bf..e8d080cab4 100644 --- a/init/main.c +++ b/init/main.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -82,7 +83,7 @@ #warning gcc-4.1.0 is known to miscompile the kernel. A different compiler version is recommended. #endif -static int init(void *); +static int kernel_init(void *); extern void init_IRQ(void); extern void fork_init(unsigned long); @@ -94,7 +95,6 @@ extern void pidmap_init(void); extern void prio_tree_init(void); extern void radix_tree_init(void); extern void free_initmem(void); -extern void prepare_namespace(void); #ifdef CONFIG_ACPI extern void acpi_early_init(void); #else @@ -384,11 +384,6 @@ static void __init setup_per_cpu_areas(void) static void __init smp_init(void) { unsigned int cpu; - unsigned highest = 0; - - for_each_cpu_mask(cpu, cpu_possible_map) - highest = cpu; - nr_cpu_ids = highest + 1; /* FIXME: This should be done in userspace --RR */ for_each_present_cpu(cpu) { @@ -431,8 +426,12 @@ static void __init setup_command_line(char *command_line) static void noinline rest_init(void) __releases(kernel_lock) { - kernel_thread(init, NULL, CLONE_FS | CLONE_SIGHAND); + int pid; + + kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND); numa_default_policy(); + pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES); + kthreadd_task = find_task_by_pid(pid); unlock_kernel(); /* @@ -654,6 +653,7 @@ static void __init do_initcalls(void) int count = preempt_count(); for (call = __initcall_start; call < __initcall_end; call++) { + ktime_t t0, t1, delta; char *msg = NULL; char msgbuf[40]; int result; @@ -663,10 +663,26 @@ static void __init do_initcalls(void) print_fn_descriptor_symbol(": %s()", (unsigned long) *call); printk("\n"); + t0 = ktime_get(); } result = (*call)(); + if (initcall_debug) { + t1 = ktime_get(); + delta = ktime_sub(t1, t0); + + printk("initcall 0x%p", *call); + print_fn_descriptor_symbol(": %s()", + (unsigned long) *call); + printk(" returned %d.\n", result); + + printk("initcall 0x%p ran for %Ld msecs: ", + *call, (unsigned long long)delta.tv64 >> 20); + print_fn_descriptor_symbol("%s()\n", + (unsigned long) *call); + } + if (result && result != -ENODEV && initcall_debug) { sprintf(msgbuf, "error code %d", result); msg = msgbuf; @@ -768,7 +784,7 @@ static int noinline init_post(void) panic("No init found. Try passing init= option to kernel."); } -static int __init init(void * unused) +static int __init kernel_init(void * unused) { lock_kernel(); /*