aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel.send@gmail.com>2008-03-21 21:56:19 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:21 -0400
commitc64df70793a9c344874eb4af19f85e0662d2d3ee (patch)
treedf6ec69fed0d4f4e2192692558dc7dc20bfa9645 /arch/x86/mm
parent9b967106da0357ef8b08847dce35584a04134f20 (diff)
x86: memtest bootparam
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/init_64.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 52f54ee4559f..ae225c3ae9a8 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -427,7 +427,10 @@ static void __init init_gbpages(void)
427 direct_gbpages = 0; 427 direct_gbpages = 0;
428} 428}
429 429
430static void __init memtest(unsigned long start_phys, unsigned long size, unsigned pattern) 430#ifdef CONFIG_MEMTEST_BOOTPARAM
431
432static void __init memtest(unsigned long start_phys, unsigned long size,
433 unsigned pattern)
431{ 434{
432 unsigned long i; 435 unsigned long i;
433 unsigned long *start; 436 unsigned long *start;
@@ -486,11 +489,12 @@ static void __init memtest(unsigned long start_phys, unsigned long size, unsigne
486 489
487} 490}
488 491
489static int __initdata memtest_pattern; 492static int memtest_pattern __initdata = CONFIG_MEMTEST_BOOTPARAM_VALUE;
493
490static int __init parse_memtest(char *arg) 494static int __init parse_memtest(char *arg)
491{ 495{
492 if (arg) 496 if (arg)
493 memtest_pattern = simple_strtoul(arg, NULL, 0) + 1; 497 memtest_pattern = simple_strtoul(arg, NULL, 0);
494 return 0; 498 return 0;
495} 499}
496 500
@@ -501,8 +505,10 @@ static void __init early_memtest(unsigned long start, unsigned long end)
501 unsigned long t_start, t_size; 505 unsigned long t_start, t_size;
502 unsigned pattern; 506 unsigned pattern;
503 507
504 if (memtest_pattern) 508 if (!memtest_pattern)
505 printk(KERN_INFO "early_memtest: pattern num %d", memtest_pattern); 509 return;
510
511 printk(KERN_INFO "early_memtest: pattern num %d", memtest_pattern);
506 for (pattern = 0; pattern < memtest_pattern; pattern++) { 512 for (pattern = 0; pattern < memtest_pattern; pattern++) {
507 t_start = start; 513 t_start = start;
508 t_size = 0; 514 t_size = 0;
@@ -523,9 +529,13 @@ static void __init early_memtest(unsigned long start, unsigned long end)
523 t_start += t_size; 529 t_start += t_size;
524 } 530 }
525 } 531 }
526 if (memtest_pattern) 532 printk(KERN_CONT "\n");
527 printk(KERN_CONT "\n");
528} 533}
534#else
535static void __init early_memtest(unsigned long start, unsigned long end)
536{
537}
538#endif
529 539
530/* 540/*
531 * Setup the direct mapping of the physical memory at PAGE_OFFSET. 541 * Setup the direct mapping of the physical memory at PAGE_OFFSET.