aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/mm/init.c
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2010-01-20 09:17:08 -0500
committerMichal Simek <monstr@monstr.eu>2010-03-11 08:16:17 -0500
commit79bf3a137617e6deeac411c39f1660b7e91d6348 (patch)
treed4f7789d79e17af51774264c9e65b26875144f84 /arch/microblaze/mm/init.c
parent1be53e084a5bd8f59850348e1066d25aa0200031 (diff)
microblaze: PCI early support for noMMU system
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/mm/init.c')
-rw-r--r--arch/microblaze/mm/init.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index aa6e163411b5..1608e2e1a44a 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -23,6 +23,9 @@
23#include <asm/sections.h> 23#include <asm/sections.h>
24#include <asm/tlb.h> 24#include <asm/tlb.h>
25 25
26/* Use for MMU and noMMU because of PCI generic code */
27int mem_init_done;
28
26#ifndef CONFIG_MMU 29#ifndef CONFIG_MMU
27unsigned int __page_offset; 30unsigned int __page_offset;
28EXPORT_SYMBOL(__page_offset); 31EXPORT_SYMBOL(__page_offset);
@@ -30,7 +33,6 @@ EXPORT_SYMBOL(__page_offset);
30#else 33#else
31DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 34DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
32 35
33int mem_init_done;
34static int init_bootmem_done; 36static int init_bootmem_done;
35#endif /* CONFIG_MMU */ 37#endif /* CONFIG_MMU */
36 38
@@ -202,9 +204,7 @@ void __init mem_init(void)
202 printk(KERN_INFO "Memory: %luk/%luk available\n", 204 printk(KERN_INFO "Memory: %luk/%luk available\n",
203 nr_free_pages() << (PAGE_SHIFT-10), 205 nr_free_pages() << (PAGE_SHIFT-10),
204 num_physpages << (PAGE_SHIFT-10)); 206 num_physpages << (PAGE_SHIFT-10));
205#ifdef CONFIG_MMU
206 mem_init_done = 1; 207 mem_init_done = 1;
207#endif
208} 208}
209 209
210#ifndef CONFIG_MMU 210#ifndef CONFIG_MMU
@@ -216,6 +216,10 @@ int ___range_ok(unsigned long addr, unsigned long size)
216} 216}
217EXPORT_SYMBOL(___range_ok); 217EXPORT_SYMBOL(___range_ok);
218 218
219int page_is_ram(unsigned long pfn)
220{
221 return __range_ok(pfn, 0);
222}
219#else 223#else
220int page_is_ram(unsigned long pfn) 224int page_is_ram(unsigned long pfn)
221{ 225{
@@ -344,6 +348,8 @@ void __init *early_get_page(void)
344 return p; 348 return p;
345} 349}
346 350
351#endif /* CONFIG_MMU */
352
347void * __init_refok alloc_maybe_bootmem(size_t size, gfp_t mask) 353void * __init_refok alloc_maybe_bootmem(size_t size, gfp_t mask)
348{ 354{
349 if (mem_init_done) 355 if (mem_init_done)
@@ -365,5 +371,3 @@ void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask)
365 } 371 }
366 return p; 372 return p;
367} 373}
368
369#endif /* CONFIG_MMU */