Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225913
b: refs/heads/master
c: af3813d
h: refs/heads/master
i:
  225911: 63499ff
v: v3
  • Loading branch information
Russell King committed Dec 22, 2010
1 parent 9932250 commit d950f01
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 614dd0585f376a25c638abbed9c5fbd21d7baece
refs/heads/master: af3813d6a5bf8d0f71b23d3ce458fa5f9916c6b7
46 changes: 31 additions & 15 deletions trunk/arch/arm/mm/idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,49 @@
#include <asm/pgalloc.h>
#include <asm/pgtable.h>

static void idmap_add_pmd(pgd_t *pgd, unsigned long addr, unsigned long end,
unsigned long prot)
{
pmd_t *pmd = pmd_offset(pgd, addr);

addr = (addr & PMD_MASK) | prot;
pmd[0] = __pmd(addr);
addr += SECTION_SIZE;
pmd[1] = __pmd(addr);
flush_pmd_entry(pmd);
}

void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end)
{
unsigned long prot;
unsigned long prot, next;

prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE;
if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale())
prot |= PMD_BIT4;

for (addr &= PGDIR_MASK; addr < end;) {
pmd_t *pmd = pmd_offset(pgd + pgd_index(addr), addr);
pmd[0] = __pmd(addr | prot);
addr += SECTION_SIZE;
pmd[1] = __pmd(addr | prot);
addr += SECTION_SIZE;
flush_pmd_entry(pmd);
}
pgd += pgd_index(addr);
do {
next = pgd_addr_end(addr, end);
idmap_add_pmd(pgd, addr, next, prot);
} while (pgd++, addr = next, addr != end);
}

#ifdef CONFIG_SMP
static void idmap_del_pmd(pgd_t *pgd, unsigned long addr, unsigned long end)
{
pmd_t *pmd = pmd_offset(pgd, addr);
pmd_clear(pmd);
}

void identity_mapping_del(pgd_t *pgd, unsigned long addr, unsigned long end)
{
for (addr &= PGDIR_MASK; addr < end; addr += PGDIR_SIZE) {
pmd_t *pmd = pmd_offset(pgd + pgd_index(addr), addr);
pmd[0] = __pmd(0);
pmd[1] = __pmd(0);
clean_pmd_entry(pmd);
}
unsigned long next;

pgd += pgd_index(addr);
do {
next = pgd_addr_end(addr, end);
idmap_del_pmd(pgd, addr, next);
} while (pgd++, addr = next, addr != end);
}
#endif

Expand Down

0 comments on commit d950f01

Please sign in to comment.