aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel
diff options
context:
space:
mode:
authorHorms <horms@verge.net.au>2006-03-23 17:27:12 -0500
committerTony Luck <tony.luck@intel.com>2006-03-23 17:27:12 -0500
commita5b00bb4fe60796c791238cf5653b82110031c93 (patch)
tree05938f68e51ad465e7ff76f05945210523061c1b /arch/ia64/kernel
parent39e18de810049e836390830174a248ad241b156a (diff)
IA64: Use early_parm to handle mvec_name and nomca
I'm not sure of the worthiness of this idea, so please consider it an RFC. Its key merits are: * Reuse existing infrastructure * Greatly tightens up the parsing of nomca * Greatly simplifies the parsing of machvec Addition cleanup (moving setup_mvec() to machvec.c) by Ken Chen. Signed-Off-By: Horms <horms@verge.net.au> Signed-Off-By: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r--arch/ia64/kernel/machvec.c19
-rw-r--r--arch/ia64/kernel/setup.c36
2 files changed, 27 insertions, 28 deletions
diff --git a/arch/ia64/kernel/machvec.c b/arch/ia64/kernel/machvec.c
index c3a04ee7f4f6..4b0b71d5aef4 100644
--- a/arch/ia64/kernel/machvec.c
+++ b/arch/ia64/kernel/machvec.c
@@ -14,7 +14,15 @@
14struct ia64_machine_vector ia64_mv; 14struct ia64_machine_vector ia64_mv;
15EXPORT_SYMBOL(ia64_mv); 15EXPORT_SYMBOL(ia64_mv);
16 16
17static struct ia64_machine_vector * 17static __initdata const char *mvec_name;
18static __init int setup_mvec(char *s)
19{
20 mvec_name = s;
21 return 0;
22}
23early_param("machvec", setup_mvec);
24
25static struct ia64_machine_vector * __init
18lookup_machvec (const char *name) 26lookup_machvec (const char *name)
19{ 27{
20 extern struct ia64_machine_vector machvec_start[]; 28 extern struct ia64_machine_vector machvec_start[];
@@ -33,10 +41,13 @@ machvec_init (const char *name)
33{ 41{
34 struct ia64_machine_vector *mv; 42 struct ia64_machine_vector *mv;
35 43
44 if (!name)
45 name = mvec_name ? mvec_name : acpi_get_sysname();
36 mv = lookup_machvec(name); 46 mv = lookup_machvec(name);
37 if (!mv) { 47 if (!mv)
38 panic("generic kernel failed to find machine vector for platform %s!", name); 48 panic("generic kernel failed to find machine vector for"
39 } 49 " platform %s!", name);
50
40 ia64_mv = *mv; 51 ia64_mv = *mv;
41 printk(KERN_INFO "booting generic kernel on platform %s\n", name); 52 printk(KERN_INFO "booting generic kernel on platform %s\n", name);
42} 53}
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index eb0793628b8a..fc860778fa41 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -389,6 +389,14 @@ check_for_logical_procs (void)
389} 389}
390#endif 390#endif
391 391
392static __initdata int nomca;
393static __init int setup_nomca(char *s)
394{
395 nomca = 1;
396 return 0;
397}
398early_param("nomca", setup_nomca);
399
392void __init 400void __init
393setup_arch (char **cmdline_p) 401setup_arch (char **cmdline_p)
394{ 402{
@@ -402,35 +410,15 @@ setup_arch (char **cmdline_p)
402 efi_init(); 410 efi_init();
403 io_port_init(); 411 io_port_init();
404 412
413 parse_early_param();
414
405#ifdef CONFIG_IA64_GENERIC 415#ifdef CONFIG_IA64_GENERIC
406 { 416 machvec_init(NULL);
407 const char *mvec_name = strstr (*cmdline_p, "machvec=");
408 char str[64];
409
410 if (mvec_name) {
411 const char *end;
412 size_t len;
413
414 mvec_name += 8;
415 end = strchr (mvec_name, ' ');
416 if (end)
417 len = end - mvec_name;
418 else
419 len = strlen (mvec_name);
420 len = min(len, sizeof (str) - 1);
421 strncpy (str, mvec_name, len);
422 str[len] = '\0';
423 mvec_name = str;
424 } else
425 mvec_name = acpi_get_sysname();
426 machvec_init(mvec_name);
427 }
428#endif 417#endif
429 418
430 if (early_console_setup(*cmdline_p) == 0) 419 if (early_console_setup(*cmdline_p) == 0)
431 mark_bsp_online(); 420 mark_bsp_online();
432 421
433 parse_early_param();
434#ifdef CONFIG_ACPI 422#ifdef CONFIG_ACPI
435 /* Initialize the ACPI boot-time table parser */ 423 /* Initialize the ACPI boot-time table parser */
436 acpi_table_init(); 424 acpi_table_init();
@@ -493,7 +481,7 @@ setup_arch (char **cmdline_p)
493#endif 481#endif
494 482
495 /* enable IA-64 Machine Check Abort Handling unless disabled */ 483 /* enable IA-64 Machine Check Abort Handling unless disabled */
496 if (!strstr(saved_command_line, "nomca")) 484 if (!nomca)
497 ia64_mca_init(); 485 ia64_mca_init();
498 486
499 platform_setup(cmdline_p); 487 platform_setup(cmdline_p);