aboutsummaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/init/main.c b/init/main.c
index 0e7aedeaa05f..09131ec090c1 100644
--- a/init/main.c
+++ b/init/main.c
@@ -642,6 +642,10 @@ asmlinkage void __init start_kernel(void)
642 "enabled early\n"); 642 "enabled early\n");
643 early_boot_irqs_on(); 643 early_boot_irqs_on();
644 local_irq_enable(); 644 local_irq_enable();
645
646 /* Interrupts are enabled now so all GFP allocations are safe. */
647 set_gfp_allowed_mask(__GFP_BITS_MASK);
648
645 kmem_cache_init_late(); 649 kmem_cache_init_late();
646 650
647 /* 651 /*
@@ -720,6 +724,17 @@ asmlinkage void __init start_kernel(void)
720 rest_init(); 724 rest_init();
721} 725}
722 726
727/* Call all constructor functions linked into the kernel. */
728static void __init do_ctors(void)
729{
730#ifdef CONFIG_CONSTRUCTORS
731 ctor_fn_t *call = (ctor_fn_t *) __ctors_start;
732
733 for (; call < (ctor_fn_t *) __ctors_end; call++)
734 (*call)();
735#endif
736}
737
723int initcall_debug; 738int initcall_debug;
724core_param(initcall_debug, initcall_debug, bool, 0644); 739core_param(initcall_debug, initcall_debug, bool, 0644);
725 740
@@ -800,6 +815,7 @@ static void __init do_basic_setup(void)
800 usermodehelper_init(); 815 usermodehelper_init();
801 driver_init(); 816 driver_init();
802 init_irq_proc(); 817 init_irq_proc();
818 do_ctors();
803 do_initcalls(); 819 do_initcalls();
804} 820}
805 821