aboutsummaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-10-15 07:46:29 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-15 07:46:29 -0400
commitb2aaf8f74cdc84a9182f6cabf198b7763bcb9d40 (patch)
tree53ccb1c2c14751fe69cf93102e76e97021f6df07 /init/main.c
parent4f962d4d65923d7b722192e729840cfb79af0a5a (diff)
parent278429cff8809958d25415ba0ed32b59866ab1a8 (diff)
Merge branch 'linus' into stackprotector
Conflicts: arch/x86/kernel/Makefile include/asm-x86/pda.h
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c54
1 files changed, 26 insertions, 28 deletions
diff --git a/init/main.c b/init/main.c
index b44e4eb0f5e3..6aaff34a38c0 100644
--- a/init/main.c
+++ b/init/main.c
@@ -23,7 +23,6 @@
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/smp_lock.h> 24#include <linux/smp_lock.h>
25#include <linux/initrd.h> 25#include <linux/initrd.h>
26#include <linux/hdreg.h>
27#include <linux/bootmem.h> 26#include <linux/bootmem.h>
28#include <linux/tty.h> 27#include <linux/tty.h>
29#include <linux/gfp.h> 28#include <linux/gfp.h>
@@ -32,6 +31,7 @@
32#include <linux/kernel_stat.h> 31#include <linux/kernel_stat.h>
33#include <linux/start_kernel.h> 32#include <linux/start_kernel.h>
34#include <linux/security.h> 33#include <linux/security.h>
34#include <linux/smp.h>
35#include <linux/workqueue.h> 35#include <linux/workqueue.h>
36#include <linux/profile.h> 36#include <linux/profile.h>
37#include <linux/rcupdate.h> 37#include <linux/rcupdate.h>
@@ -87,8 +87,6 @@ extern void init_IRQ(void);
87extern void fork_init(unsigned long); 87extern void fork_init(unsigned long);
88extern void mca_init(void); 88extern void mca_init(void);
89extern void sbus_init(void); 89extern void sbus_init(void);
90extern void pidhash_init(void);
91extern void pidmap_init(void);
92extern void prio_tree_init(void); 90extern void prio_tree_init(void);
93extern void radix_tree_init(void); 91extern void radix_tree_init(void);
94extern void free_initmem(void); 92extern void free_initmem(void);
@@ -415,6 +413,13 @@ static void __init smp_init(void)
415{ 413{
416 unsigned int cpu; 414 unsigned int cpu;
417 415
416 /*
417 * Set up the current CPU as possible to migrate to.
418 * The other ones will be done by cpu_up/cpu_down()
419 */
420 cpu = smp_processor_id();
421 cpu_set(cpu, cpu_active_map);
422
418 /* FIXME: This should be done in userspace --RR */ 423 /* FIXME: This should be done in userspace --RR */
419 for_each_present_cpu(cpu) { 424 for_each_present_cpu(cpu) {
420 if (num_online_cpus() >= setup_max_cpus) 425 if (num_online_cpus() >= setup_max_cpus)
@@ -636,9 +641,11 @@ asmlinkage void __init start_kernel(void)
636 641
637#ifdef CONFIG_BLK_DEV_INITRD 642#ifdef CONFIG_BLK_DEV_INITRD
638 if (initrd_start && !initrd_below_start_ok && 643 if (initrd_start && !initrd_below_start_ok &&
639 initrd_start < min_low_pfn << PAGE_SHIFT) { 644 page_to_pfn(virt_to_page((void *)initrd_start)) < min_low_pfn) {
640 printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - " 645 printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - "
641 "disabling it.\n",initrd_start,min_low_pfn << PAGE_SHIFT); 646 "disabling it.\n",
647 page_to_pfn(virt_to_page((void *)initrd_start)),
648 min_low_pfn);
642 initrd_start = 0; 649 initrd_start = 0;
643 } 650 }
644#endif 651#endif
@@ -691,7 +698,7 @@ asmlinkage void __init start_kernel(void)
691 rest_init(); 698 rest_init();
692} 699}
693 700
694static int __initdata initcall_debug; 701static int initcall_debug;
695 702
696static int __init initcall_debug_setup(char *str) 703static int __init initcall_debug_setup(char *str)
697{ 704{
@@ -700,7 +707,7 @@ static int __init initcall_debug_setup(char *str)
700} 707}
701__setup("initcall_debug", initcall_debug_setup); 708__setup("initcall_debug", initcall_debug_setup);
702 709
703static void __init do_one_initcall(initcall_t fn) 710int do_one_initcall(initcall_t fn)
704{ 711{
705 int count = preempt_count(); 712 int count = preempt_count();
706 ktime_t t0, t1, delta; 713 ktime_t t0, t1, delta;
@@ -708,7 +715,7 @@ static void __init do_one_initcall(initcall_t fn)
708 int result; 715 int result;
709 716
710 if (initcall_debug) { 717 if (initcall_debug) {
711 print_fn_descriptor_symbol("calling %s\n", fn); 718 printk("calling %pF @ %i\n", fn, task_pid_nr(current));
712 t0 = ktime_get(); 719 t0 = ktime_get();
713 } 720 }
714 721
@@ -718,8 +725,8 @@ static void __init do_one_initcall(initcall_t fn)
718 t1 = ktime_get(); 725 t1 = ktime_get();
719 delta = ktime_sub(t1, t0); 726 delta = ktime_sub(t1, t0);
720 727
721 print_fn_descriptor_symbol("initcall %s", fn); 728 printk("initcall %pF returned %d after %Ld msecs\n",
722 printk(" returned %d after %Ld msecs\n", result, 729 fn, result,
723 (unsigned long long) delta.tv64 >> 20); 730 (unsigned long long) delta.tv64 >> 20);
724 } 731 }
725 732
@@ -737,19 +744,20 @@ static void __init do_one_initcall(initcall_t fn)
737 local_irq_enable(); 744 local_irq_enable();
738 } 745 }
739 if (msgbuf[0]) { 746 if (msgbuf[0]) {
740 print_fn_descriptor_symbol(KERN_WARNING "initcall %s", fn); 747 printk("initcall %pF returned with %s\n", fn, msgbuf);
741 printk(" returned with %s\n", msgbuf);
742 } 748 }
749
750 return result;
743} 751}
744 752
745 753
746extern initcall_t __initcall_start[], __initcall_end[]; 754extern initcall_t __initcall_start[], __initcall_end[], __early_initcall_end[];
747 755
748static void __init do_initcalls(void) 756static void __init do_initcalls(void)
749{ 757{
750 initcall_t *call; 758 initcall_t *call;
751 759
752 for (call = __initcall_start; call < __initcall_end; call++) 760 for (call = __early_initcall_end; call < __initcall_end; call++)
753 do_one_initcall(*call); 761 do_one_initcall(*call);
754 762
755 /* Make sure there is no pending stuff from the initcall sequence */ 763 /* Make sure there is no pending stuff from the initcall sequence */
@@ -765,6 +773,7 @@ static void __init do_initcalls(void)
765 */ 773 */
766static void __init do_basic_setup(void) 774static void __init do_basic_setup(void)
767{ 775{
776 rcu_init_sched(); /* needed by module_init stage. */
768 /* drivers will send hotplug events */ 777 /* drivers will send hotplug events */
769 init_workqueues(); 778 init_workqueues();
770 usermodehelper_init(); 779 usermodehelper_init();
@@ -773,23 +782,12 @@ static void __init do_basic_setup(void)
773 do_initcalls(); 782 do_initcalls();
774} 783}
775 784
776static int __initdata nosoftlockup;
777
778static int __init nosoftlockup_setup(char *str)
779{
780 nosoftlockup = 1;
781 return 1;
782}
783__setup("nosoftlockup", nosoftlockup_setup);
784
785static void __init do_pre_smp_initcalls(void) 785static void __init do_pre_smp_initcalls(void)
786{ 786{
787 extern int spawn_ksoftirqd(void); 787 initcall_t *call;
788 788
789 migration_init(); 789 for (call = __initcall_start; call < __early_initcall_end; call++)
790 spawn_ksoftirqd(); 790 do_one_initcall(*call);
791 if (!nosoftlockup)
792 spawn_softlockup_task();
793} 791}
794 792
795static void run_init_process(char *init_filename) 793static void run_init_process(char *init_filename)