23 #include <linux/module.h>
24 #include <linux/errno.h>
31 #include <asm/cputype.h>
32 #include <asm/cacheflush.h>
33 #include <asm/mmu_context.h>
34 #include <asm/pgalloc.h>
35 #include <asm/tlbflush.h>
61 }
while (seq !=
init_mm.context.kvm_seq);
64 #if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
75 static void unmap_area_sections(
unsigned long virt,
unsigned long size)
77 unsigned long addr = virt,
end = virt + (size & ~(
SZ_1M - 1));
115 if (
current->active_mm->context.kvm_seq !=
init_mm.context.kvm_seq)
122 remap_area_sections(
unsigned long virt,
unsigned long pfn,
134 unmap_area_sections(virt, size);
144 flush_pmd_entry(pmd);
148 }
while (addr < end);
154 remap_area_supersections(
unsigned long virt,
unsigned long pfn,
155 size_t size,
const struct mem_type *type)
157 unsigned long addr = virt, end = virt +
size;
166 unmap_area_sections(virt, size);
172 unsigned long super_pmd_val,
i;
176 super_pmd_val |= ((pfn >> (32 -
PAGE_SHIFT)) & 0xf) << 20;
178 for (i = 0; i < 8; i++) {
179 pmd[0] =
__pmd(super_pmd_val);
180 pmd[1] =
__pmd(super_pmd_val);
181 flush_pmd_entry(pmd);
188 }
while (addr < end);
195 unsigned long offset,
size_t size,
unsigned int mtype,
void *
caller)
202 #ifndef CONFIG_ARM_LPAE
223 for (area =
vmlist; area; area = area->
next) {
224 if (!size || (
sizeof(
phys_addr_t) == 4 && pfn >= 0x100000))
226 if (!(area->
flags & VM_ARM_STATIC_MAPPING))
228 if ((area->
flags & VM_ARM_MTYPE_MASK) != VM_ARM_MTYPE(mtype))
253 #if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
258 area->
flags |= VM_ARM_SECTION_MAPPING;
259 err = remap_area_supersections(addr, pfn, size, type);
261 area->
flags |= VM_ARM_SECTION_MAPPING;
262 err = remap_area_sections(addr, pfn, size, type);
278 unsigned int mtype,
void *
caller)
280 unsigned long last_addr;
287 last_addr = phys_addr + size - 1;
288 if (!size || last_addr < phys_addr)
309 __builtin_return_address(0));
314 unsigned int,
void *) =
321 __builtin_return_address(0));
343 __builtin_return_address(0));
358 if ((vm->
flags & VM_ARM_STATIC_MAPPING) &&
363 #if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
369 if ((vm->
addr == addr) &&
370 (vm->
flags & VM_ARM_SECTION_MAPPING)) {
371 unmap_area_sections((
unsigned long)vm->
addr, vm->
size);
395 PCI_IO_VIRT_BASE + offset +
SZ_64K,