aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/mm/pgtable.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/microblaze/mm/pgtable.c')
-rw-r--r--arch/microblaze/mm/pgtable.c52
1 files changed, 16 insertions, 36 deletions
diff --git a/arch/microblaze/mm/pgtable.c b/arch/microblaze/mm/pgtable.c
index d31312cde6ea..59bf2335a4ce 100644
--- a/arch/microblaze/mm/pgtable.c
+++ b/arch/microblaze/mm/pgtable.c
@@ -42,6 +42,7 @@
42 42
43unsigned long ioremap_base; 43unsigned long ioremap_base;
44unsigned long ioremap_bot; 44unsigned long ioremap_bot;
45EXPORT_SYMBOL(ioremap_bot);
45 46
46/* The maximum lowmem defaults to 768Mb, but this can be configured to 47/* The maximum lowmem defaults to 768Mb, but this can be configured to
47 * another value. 48 * another value.
@@ -161,24 +162,6 @@ int map_page(unsigned long va, phys_addr_t pa, int flags)
161 return err; 162 return err;
162} 163}
163 164
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/* 165/*
183 * Map in all of physical memory starting at CONFIG_KERNEL_START. 166 * Map in all of physical memory starting at CONFIG_KERNEL_START.
184 */ 167 */
@@ -206,24 +189,6 @@ void __init mapin_ram(void)
206/* is x a power of 2? */ 189/* is x a power of 2? */
207#define is_power_of_2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0)) 190#define is_power_of_2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0))
208 191
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 192/* Scan the real Linux page tables and return a PTE pointer for
228 * a virtual address in a context. 193 * a virtual address in a context.
229 * Returns true (1) if PTE was found, zero otherwise. The pointer to 194 * Returns true (1) if PTE was found, zero otherwise. The pointer to
@@ -274,3 +239,18 @@ unsigned long iopa(unsigned long addr)
274 239
275 return pa; 240 return pa;
276} 241}
242
243__init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
244 unsigned long address)
245{
246 pte_t *pte;
247 if (mem_init_done) {
248 pte = (pte_t *)__get_free_page(GFP_KERNEL |
249 __GFP_REPEAT | __GFP_ZERO);
250 } else {
251 pte = (pte_t *)early_get_page();
252 if (pte)
253 clear_page(pte);
254 }
255 return pte;
256}