1 #include <linux/kernel.h>
3 #include <asm/cputype.h>
5 #include <asm/pgalloc.h>
6 #include <asm/pgtable.h>
7 #include <asm/sections.h>
12 #ifdef CONFIG_ARM_LPAE
13 static void idmap_add_pmd(
pud_t *pud,
unsigned long addr,
unsigned long end,
22 pr_warning(
"Failed to allocate identity pmd.\n");
34 }
while (pmd++, addr = next, addr != end);
37 static void idmap_add_pmd(
pud_t *pud,
unsigned long addr,
unsigned long end,
50 static void idmap_add_pud(
pgd_t *pgd,
unsigned long addr,
unsigned long end,
58 idmap_add_pmd(pud, addr, next, prot);
59 }
while (pud++, addr = next, addr != end);
62 static void identity_mapping_add(
pgd_t *pgd,
unsigned long addr,
unsigned long end)
64 unsigned long prot,
next;
72 next = pgd_addr_end(addr, end);
73 idmap_add_pud(pgd, addr, next, prot);
74 }
while (pgd++, addr = next, addr != end);
79 static int __init init_static_idmap(
void)
91 pr_info(
"Setting up static identity map for 0x%llx - 0x%llx\n",
92 (
long long)idmap_start, (
long long)idmap_end);
93 identity_mapping_add(idmap_pgd, idmap_start, idmap_end);
110 cpu_switch_mm(idmap_pgd, &
init_mm);