X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=init%2Fmain.c;h=c1537e0ddcebdc549d4b5d426640e81e878cff79;hb=8a63011275e1a0ec9389e8c7d9b08caab8957ca0;hp=a92989e7836af6acb73bb6ce8b95ad76ee727f53;hpb=9654640d0af8f2de40ff3807d3695109d3463f54;p=powerpc.git diff --git a/init/main.c b/init/main.c index a92989e783..c1537e0ddc 100644 --- a/init/main.c +++ b/init/main.c @@ -82,7 +82,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 +94,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 @@ -369,12 +368,8 @@ static void __init setup_per_cpu_areas(void) unsigned long nr_possible_cpus = num_possible_cpus(); /* Copy section for each CPU (we discard the original) */ - size = ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES); -#ifdef CONFIG_MODULES - if (size < PERCPU_ENOUGH_ROOM) - size = PERCPU_ENOUGH_ROOM; -#endif - ptr = alloc_bootmem(size * nr_possible_cpus); + size = ALIGN(PERCPU_ENOUGH_ROOM, PAGE_SIZE); + ptr = alloc_bootmem_pages(size * nr_possible_cpus); for_each_possible_cpu(i) { __per_cpu_offset[i] = ptr - __per_cpu_start; @@ -388,11 +383,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) { @@ -435,7 +425,7 @@ 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); + kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND); numa_default_policy(); unlock_kernel(); @@ -658,6 +648,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; @@ -667,10 +658,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; @@ -772,7 +779,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(); /*