aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/mm/pgtable.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-05-17 12:24:04 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-05-17 12:24:04 -0400
commitac1d426e825ab5778995f2f6f053ca2e6b45c622 (patch)
tree75b91356ca39463e0112931aa6790802fb1e07a2 /arch/microblaze/mm/pgtable.c
parentfda0e18c8a7a3e02747c2b045b4fcd2c920410b9 (diff)
parenta3685f00652af83f12b63e3b4ef48f29581ba48b (diff)
Merge branch 'devel-stable' into devel
Conflicts: arch/arm/Kconfig arch/arm/include/asm/system.h arch/arm/mm/Kconfig
Diffstat (limited to 'arch/microblaze/mm/pgtable.c')
-rw-r--r--arch/microblaze/mm/pgtable.c53
1 files changed, 16 insertions, 37 deletions
diff --git a/arch/microblaze/mm/pgtable.c b/arch/microblaze/mm/pgtable.c
index 63a6fd07c48f..784557fb28cf 100644
--- a/arch/microblaze/mm/pgtable.c
+++ b/arch/microblaze/mm/pgtable.c
@@ -154,31 +154,13 @@ int map_page(unsigned long va, phys_addr_t pa, int flags)
154 err = 0; 154 err = 0;
155 set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT, 155 set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT,
156 __pgprot(flags))); 156 __pgprot(flags)));
157 if (mem_init_done) 157 if (unlikely(mem_init_done))
158 flush_HPTE(0, va, pmd_val(*pd)); 158 flush_HPTE(0, va, pmd_val(*pd));
159 /* flush_HPTE(0, va, pg); */ 159 /* flush_HPTE(0, va, pg); */
160 } 160 }
161 return err; 161 return err;
162} 162}
163 163
164void __init adjust_total_lowmem(void)
165{
166/* TBD */
167#if 0
168 unsigned long max_low_mem = MAX_LOW_MEM;
169
170 if (total_lowmem > max_low_mem) {
171 total_lowmem = max_low_mem;
172#ifndef CONFIG_HIGHMEM
173 printk(KERN_INFO "Warning, memory limited to %ld Mb, use "
174 "CONFIG_HIGHMEM to reach %ld Mb\n",
175 max_low_mem >> 20, total_memory >> 20);
176 total_memory = total_lowmem;
177#endif /* CONFIG_HIGHMEM */
178 }
179#endif
180}
181
182/* 164/*
183 * Map in all of physical memory starting at CONFIG_KERNEL_START. 165 * Map in all of physical memory starting at CONFIG_KERNEL_START.
184 */ 166 */
@@ -206,24 +188,6 @@ void __init mapin_ram(void)
206/* is x a power of 2? */ 188/* is x a power of 2? */
207#define is_power_of_2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0)) 189#define is_power_of_2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0))
208 190
209/*
210 * Set up a mapping for a block of I/O.
211 * virt, phys, size must all be page-aligned.
212 * This should only be called before ioremap is called.
213 */
214void __init io_block_mapping(unsigned long virt, phys_addr_t phys,
215 unsigned int size, int flags)
216{
217 int i;
218
219 if (virt > CONFIG_KERNEL_START && virt < ioremap_bot)
220 ioremap_bot = ioremap_base = virt;
221
222 /* Put it in the page tables. */
223 for (i = 0; i < size; i += PAGE_SIZE)
224 map_page(virt + i, phys + i, flags);
225}
226
227/* Scan the real Linux page tables and return a PTE pointer for 191/* Scan the real Linux page tables and return a PTE pointer for
228 * a virtual address in a context. 192 * a virtual address in a context.
229 * Returns true (1) if PTE was found, zero otherwise. The pointer to 193 * Returns true (1) if PTE was found, zero otherwise. The pointer to
@@ -274,3 +238,18 @@ unsigned long iopa(unsigned long addr)
274 238
275 return pa; 239 return pa;
276} 240}
241
242__init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
243 unsigned long address)
244{
245 pte_t *pte;
246 if (mem_init_done) {
247 pte = (pte_t *)__get_free_page(GFP_KERNEL |
248 __GFP_REPEAT | __GFP_ZERO);
249 } else {
250 pte = (pte_t *)early_get_page();
251 if (pte)
252 clear_page(pte);
253 }
254 return pte;
255}