diff options
Diffstat (limited to 'arch/arc')
-rw-r--r-- | arch/arc/mm/init.c | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c index 4a177365b2c4..a08ce7185423 100644 --- a/arch/arc/mm/init.c +++ b/arch/arc/mm/init.c | |||
@@ -74,7 +74,7 @@ void __init setup_arch_memory(void) | |||
74 | /* Last usable page of low mem (no HIGHMEM yet for ARC port) */ | 74 | /* Last usable page of low mem (no HIGHMEM yet for ARC port) */ |
75 | max_low_pfn = max_pfn = PFN_DOWN(end_mem); | 75 | max_low_pfn = max_pfn = PFN_DOWN(end_mem); |
76 | 76 | ||
77 | max_mapnr = num_physpages = max_low_pfn - min_low_pfn; | 77 | max_mapnr = max_low_pfn - min_low_pfn; |
78 | 78 | ||
79 | /*------------- reserve kernel image -----------------------*/ | 79 | /*------------- reserve kernel image -----------------------*/ |
80 | memblock_reserve(CONFIG_LINUX_LINK_BASE, | 80 | memblock_reserve(CONFIG_LINUX_LINK_BASE, |
@@ -84,7 +84,7 @@ void __init setup_arch_memory(void) | |||
84 | 84 | ||
85 | /*-------------- node setup --------------------------------*/ | 85 | /*-------------- node setup --------------------------------*/ |
86 | memset(zones_size, 0, sizeof(zones_size)); | 86 | memset(zones_size, 0, sizeof(zones_size)); |
87 | zones_size[ZONE_NORMAL] = num_physpages; | 87 | zones_size[ZONE_NORMAL] = max_low_pfn - min_low_pfn; |
88 | 88 | ||
89 | /* | 89 | /* |
90 | * We can't use the helper free_area_init(zones[]) because it uses | 90 | * We can't use the helper free_area_init(zones[]) because it uses |
@@ -106,39 +106,9 @@ void __init setup_arch_memory(void) | |||
106 | */ | 106 | */ |
107 | void __init mem_init(void) | 107 | void __init mem_init(void) |
108 | { | 108 | { |
109 | int codesize, datasize, initsize, reserved_pages, free_pages; | ||
110 | int tmp; | ||
111 | |||
112 | high_memory = (void *)(CONFIG_LINUX_LINK_BASE + arc_mem_sz); | 109 | high_memory = (void *)(CONFIG_LINUX_LINK_BASE + arc_mem_sz); |
113 | 110 | free_all_bootmem(); | |
114 | totalram_pages = free_all_bootmem(); | 111 | mem_init_print_info(NULL); |
115 | |||
116 | /* count all reserved pages [kernel code/data/mem_map..] */ | ||
117 | reserved_pages = 0; | ||
118 | for (tmp = 0; tmp < max_mapnr; tmp++) | ||
119 | if (PageReserved(mem_map + tmp)) | ||
120 | reserved_pages++; | ||
121 | |||
122 | /* XXX: nr_free_pages() is equivalent */ | ||
123 | free_pages = max_mapnr - reserved_pages; | ||
124 | |||
125 | /* | ||
126 | * For the purpose of display below, split the "reserve mem" | ||
127 | * kernel code/data is already shown explicitly, | ||
128 | * Show any other reservations (mem_map[ ] et al) | ||
129 | */ | ||
130 | reserved_pages -= (((unsigned int)_end - CONFIG_LINUX_LINK_BASE) >> | ||
131 | PAGE_SHIFT); | ||
132 | |||
133 | codesize = _etext - _text; | ||
134 | datasize = _end - _etext; | ||
135 | initsize = __init_end - __init_begin; | ||
136 | |||
137 | pr_info("Memory Available: %dM / %ldM (%dK code, %dK data, %dK init, %dK reserv)\n", | ||
138 | PAGES_TO_MB(free_pages), | ||
139 | TO_MB(arc_mem_sz), | ||
140 | TO_KB(codesize), TO_KB(datasize), TO_KB(initsize), | ||
141 | PAGES_TO_KB(reserved_pages)); | ||
142 | } | 112 | } |
143 | 113 | ||
144 | /* | 114 | /* |
@@ -146,13 +116,13 @@ void __init mem_init(void) | |||
146 | */ | 116 | */ |
147 | void __init_refok free_initmem(void) | 117 | void __init_refok free_initmem(void) |
148 | { | 118 | { |
149 | free_initmem_default(0); | 119 | free_initmem_default(-1); |
150 | } | 120 | } |
151 | 121 | ||
152 | #ifdef CONFIG_BLK_DEV_INITRD | 122 | #ifdef CONFIG_BLK_DEV_INITRD |
153 | void __init free_initrd_mem(unsigned long start, unsigned long end) | 123 | void __init free_initrd_mem(unsigned long start, unsigned long end) |
154 | { | 124 | { |
155 | free_reserved_area(start, end, 0, "initrd"); | 125 | free_reserved_area((void *)start, (void *)end, -1, "initrd"); |
156 | } | 126 | } |
157 | #endif | 127 | #endif |
158 | 128 | ||