diff options
Diffstat (limited to 'init')
-rw-r--r-- | init/Kconfig | 5 | ||||
-rw-r--r-- | init/main.c | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/init/Kconfig b/init/Kconfig index c4b3c6d51a72..1ce05a4cb5f6 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -16,6 +16,11 @@ config DEFCONFIG_LIST | |||
16 | default "$ARCH_DEFCONFIG" | 16 | default "$ARCH_DEFCONFIG" |
17 | default "arch/$ARCH/defconfig" | 17 | default "arch/$ARCH/defconfig" |
18 | 18 | ||
19 | config CONSTRUCTORS | ||
20 | bool | ||
21 | depends on !UML | ||
22 | default y | ||
23 | |||
19 | menu "General setup" | 24 | menu "General setup" |
20 | 25 | ||
21 | config EXPERIMENTAL | 26 | config EXPERIMENTAL |
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. */ | ||
728 | static 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 | |||
723 | int initcall_debug; | 738 | int initcall_debug; |
724 | core_param(initcall_debug, initcall_debug, bool, 0644); | 739 | core_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 | ||