diff options
Diffstat (limited to 'init/main.c')
-rw-r--r-- | init/main.c | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/init/main.c b/init/main.c index 8651a720a092..0766e69712b2 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -128,6 +128,18 @@ static char *ramdisk_execute_command; | |||
128 | static unsigned int max_cpus = NR_CPUS; | 128 | static unsigned int max_cpus = NR_CPUS; |
129 | 129 | ||
130 | /* | 130 | /* |
131 | * If set, this is an indication to the drivers that reset the underlying | ||
132 | * device before going ahead with the initialization otherwise driver might | ||
133 | * rely on the BIOS and skip the reset operation. | ||
134 | * | ||
135 | * This is useful if kernel is booting in an unreliable environment. | ||
136 | * For ex. kdump situaiton where previous kernel has crashed, BIOS has been | ||
137 | * skipped and devices will be in unknown state. | ||
138 | */ | ||
139 | unsigned int reset_devices; | ||
140 | EXPORT_SYMBOL(reset_devices); | ||
141 | |||
142 | /* | ||
131 | * Setup routine for controlling SMP activation | 143 | * Setup routine for controlling SMP activation |
132 | * | 144 | * |
133 | * Command-line option of "nosmp" or "maxcpus=0" will disable SMP | 145 | * Command-line option of "nosmp" or "maxcpus=0" will disable SMP |
@@ -153,6 +165,14 @@ static int __init maxcpus(char *str) | |||
153 | 165 | ||
154 | __setup("maxcpus=", maxcpus); | 166 | __setup("maxcpus=", maxcpus); |
155 | 167 | ||
168 | static int __init set_reset_devices(char *str) | ||
169 | { | ||
170 | reset_devices = 1; | ||
171 | return 1; | ||
172 | } | ||
173 | |||
174 | __setup("reset_devices", set_reset_devices); | ||
175 | |||
156 | static char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, }; | 176 | static char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, }; |
157 | char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, }; | 177 | char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, }; |
158 | static const char *panic_later, *panic_param; | 178 | static const char *panic_later, *panic_param; |
@@ -162,16 +182,19 @@ extern struct obs_kernel_param __setup_start[], __setup_end[]; | |||
162 | static int __init obsolete_checksetup(char *line) | 182 | static int __init obsolete_checksetup(char *line) |
163 | { | 183 | { |
164 | struct obs_kernel_param *p; | 184 | struct obs_kernel_param *p; |
185 | int had_early_param = 0; | ||
165 | 186 | ||
166 | p = __setup_start; | 187 | p = __setup_start; |
167 | do { | 188 | do { |
168 | int n = strlen(p->str); | 189 | int n = strlen(p->str); |
169 | if (!strncmp(line, p->str, n)) { | 190 | if (!strncmp(line, p->str, n)) { |
170 | if (p->early) { | 191 | if (p->early) { |
171 | /* Already done in parse_early_param? (Needs | 192 | /* Already done in parse_early_param? |
172 | * exact match on param part) */ | 193 | * (Needs exact match on param part). |
194 | * Keep iterating, as we can have early | ||
195 | * params and __setups of same names 8( */ | ||
173 | if (line[n] == '\0' || line[n] == '=') | 196 | if (line[n] == '\0' || line[n] == '=') |
174 | return 1; | 197 | had_early_param = 1; |
175 | } else if (!p->setup_func) { | 198 | } else if (!p->setup_func) { |
176 | printk(KERN_WARNING "Parameter %s is obsolete," | 199 | printk(KERN_WARNING "Parameter %s is obsolete," |
177 | " ignored\n", p->str); | 200 | " ignored\n", p->str); |
@@ -181,7 +204,8 @@ static int __init obsolete_checksetup(char *line) | |||
181 | } | 204 | } |
182 | p++; | 205 | p++; |
183 | } while (p < __setup_end); | 206 | } while (p < __setup_end); |
184 | return 0; | 207 | |
208 | return had_early_param; | ||
185 | } | 209 | } |
186 | 210 | ||
187 | /* | 211 | /* |
@@ -464,6 +488,7 @@ asmlinkage void __init start_kernel(void) | |||
464 | * Need to run as early as possible, to initialize the | 488 | * Need to run as early as possible, to initialize the |
465 | * lockdep hash: | 489 | * lockdep hash: |
466 | */ | 490 | */ |
491 | unwind_init(); | ||
467 | lockdep_init(); | 492 | lockdep_init(); |
468 | 493 | ||
469 | local_irq_disable(); | 494 | local_irq_disable(); |
@@ -502,7 +527,6 @@ asmlinkage void __init start_kernel(void) | |||
502 | __stop___param - __start___param, | 527 | __stop___param - __start___param, |
503 | &unknown_bootoption); | 528 | &unknown_bootoption); |
504 | sort_main_extable(); | 529 | sort_main_extable(); |
505 | unwind_init(); | ||
506 | trap_init(); | 530 | trap_init(); |
507 | rcu_init(); | 531 | rcu_init(); |
508 | init_IRQ(); | 532 | init_IRQ(); |