Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80538
b: refs/heads/master
c: ff31452
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Jan 30, 2008
1 parent 69ef708 commit 4858836
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 72932c7ad2cc309b0ba6149aa31faa26aaee54d5
refs/heads/master: ff31452b6ea5032f26f16140d45dc6596260cd9c
39 changes: 39 additions & 0 deletions trunk/arch/x86/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,45 @@ static int change_page_attr_addr(unsigned long address, pgprot_t prot)
return err;
}

static int __change_page_attr_set_clr(unsigned long addr, int numpages,
pgprot_t mask_set, pgprot_t mask_clr)
{
pgprot_t new_prot;
int level;
pte_t *pte;
int i, ret;

for (i = 0; i < numpages ; i++) {

pte = lookup_address(addr, &level);
if (!pte)
return -EINVAL;

new_prot = pte_pgprot(*pte);

pgprot_val(new_prot) &= ~pgprot_val(mask_clr);
pgprot_val(new_prot) |= pgprot_val(mask_set);

ret = change_page_attr_addr(addr, new_prot);
if (ret)
return ret;
addr += PAGE_SIZE;
}

return 0;
}

static int change_page_attr_set_clr(unsigned long addr, int numpages,
pgprot_t mask_set, pgprot_t mask_clr)
{
int ret = __change_page_attr_set_clr(addr, numpages, mask_set,
mask_clr);

global_flush_tlb();

return ret;
}

/**
* change_page_attr_set - Change page table attributes in the linear mapping.
* @addr: Virtual address in linear mapping.
Expand Down

0 comments on commit 4858836

Please sign in to comment.