diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2009-03-03 07:10:12 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-03 07:13:15 -0500 |
commit | 867c5b5292583b1e474cbbcb4c77f09bfca3903c (patch) | |
tree | 44b0d467ce71aa7a68ef5fcb2b256555fa664f4b /arch/x86/mm/highmem_32.c | |
parent | e5b2bb552706ca0e30795ee84caacbb37cec5705 (diff) |
x86: set_highmem_pages_init() cleanup
Impact: cleanup
This patch moves set_highmem_pages_init() to arch/x86/mm/highmem_32.c.
The declaration of the function is kept in asm/numa_32.h because
asm/highmem.h is included only if CONFIG_HIGHMEM is enabled so we
can't put the empty static inline function there.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
LKML-Reference: <1236082212.2675.24.camel@penberg-laptop>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/highmem_32.c')
-rw-r--r-- | arch/x86/mm/highmem_32.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c index bcc079c282dd..13a823cf564c 100644 --- a/arch/x86/mm/highmem_32.c +++ b/arch/x86/mm/highmem_32.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/highmem.h> | 1 | #include <linux/highmem.h> |
2 | #include <linux/module.h> | 2 | #include <linux/module.h> |
3 | #include <linux/swap.h> /* for totalram_pages */ | ||
3 | 4 | ||
4 | void *kmap(struct page *page) | 5 | void *kmap(struct page *page) |
5 | { | 6 | { |
@@ -156,3 +157,36 @@ EXPORT_SYMBOL(kmap); | |||
156 | EXPORT_SYMBOL(kunmap); | 157 | EXPORT_SYMBOL(kunmap); |
157 | EXPORT_SYMBOL(kmap_atomic); | 158 | EXPORT_SYMBOL(kmap_atomic); |
158 | EXPORT_SYMBOL(kunmap_atomic); | 159 | EXPORT_SYMBOL(kunmap_atomic); |
160 | |||
161 | #ifdef CONFIG_NUMA | ||
162 | void __init set_highmem_pages_init(void) | ||
163 | { | ||
164 | struct zone *zone; | ||
165 | int nid; | ||
166 | |||
167 | for_each_zone(zone) { | ||
168 | unsigned long zone_start_pfn, zone_end_pfn; | ||
169 | |||
170 | if (!is_highmem(zone)) | ||
171 | continue; | ||
172 | |||
173 | zone_start_pfn = zone->zone_start_pfn; | ||
174 | zone_end_pfn = zone_start_pfn + zone->spanned_pages; | ||
175 | |||
176 | nid = zone_to_nid(zone); | ||
177 | printk(KERN_INFO "Initializing %s for node %d (%08lx:%08lx)\n", | ||
178 | zone->name, nid, zone_start_pfn, zone_end_pfn); | ||
179 | |||
180 | add_highpages_with_active_regions(nid, zone_start_pfn, | ||
181 | zone_end_pfn); | ||
182 | } | ||
183 | totalram_pages += totalhigh_pages; | ||
184 | } | ||
185 | #else | ||
186 | static void __init set_highmem_pages_init(void) | ||
187 | { | ||
188 | add_highpages_with_active_regions(0, highstart_pfn, highend_pfn); | ||
189 | |||
190 | totalram_pages += totalhigh_pages; | ||
191 | } | ||
192 | #endif /* CONFIG_NUMA */ | ||