aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHirokazu Takata <takata@linux-m32r.org>2009-09-23 08:37:06 -0400
committerHirokazu Takata <takata@linux-m32r.org>2009-10-03 23:02:36 -0400
commit6b6fabce5ac47668a2c2d9a14f1cdcc23c4ed896 (patch)
tree2d0aef1bfaf9f8e471d3f5b420edc06bd5d1e148 /arch
parentbac33bd571a9c2969efb52dd02c5407fbc49c360 (diff)
m32r: Fix set_memory() for DISCONTIGMEM
In case CONFIG_DISCONTIGMEM is set, the memory size of system was always determined by CONFIG_MEMORY_SIZE and was not changeable. This patch fixes set_memory() of arch/m32r/mm/discontig.c so that we can specify memory size by the "mem=<size>" kernel parameter. Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/m32r/mm/discontig.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/m32r/mm/discontig.c b/arch/m32r/mm/discontig.c
index b7a78ad429b7..5d2858f6eede 100644
--- a/arch/m32r/mm/discontig.c
+++ b/arch/m32r/mm/discontig.c
@@ -32,6 +32,9 @@ typedef struct {
32} mem_prof_t; 32} mem_prof_t;
33static mem_prof_t mem_prof[MAX_NUMNODES]; 33static mem_prof_t mem_prof[MAX_NUMNODES];
34 34
35extern unsigned long memory_start;
36extern unsigned long memory_end;
37
35static void __init mem_prof_init(void) 38static void __init mem_prof_init(void)
36{ 39{
37 unsigned long start_pfn, holes, free_pfn; 40 unsigned long start_pfn, holes, free_pfn;
@@ -42,7 +45,7 @@ static void __init mem_prof_init(void)
42 /* Node#0 SDRAM */ 45 /* Node#0 SDRAM */
43 mp = &mem_prof[0]; 46 mp = &mem_prof[0];
44 mp->start_pfn = PFN_UP(CONFIG_MEMORY_START); 47 mp->start_pfn = PFN_UP(CONFIG_MEMORY_START);
45 mp->pages = PFN_DOWN(CONFIG_MEMORY_SIZE); 48 mp->pages = PFN_DOWN(memory_end - memory_start);
46 mp->holes = 0; 49 mp->holes = 0;
47 mp->free_pfn = PFN_UP(__pa(_end)); 50 mp->free_pfn = PFN_UP(__pa(_end));
48 51