Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80219
b: refs/heads/master
c: 3847231
h: refs/heads/master
i:
  80217: fec92cb
  80215: 1854901
v: v3
  • Loading branch information
Ingo Molnar committed Jan 30, 2008
1 parent ce2fa7a commit a8ede27
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 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: 6fdc05d4794056e0b98901646c4b68c60a01d5eb
refs/heads/master: 38472311679d8784c2934d071ddda23d9b3fe264
15 changes: 15 additions & 0 deletions trunk/include/asm-x86/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,21 @@ static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot)
pgprot_val(pgprot)) & __supported_pte_mask);
}

static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
{
pteval_t val = pte_val(pte);

/*
* Chop off the NX bit (if present), and add the NX portion of
* the newprot (if present):
*/
val &= _PAGE_CHG_MASK & ~_PAGE_NX;
val |= pgprot_val(newprot) & __supported_pte_mask;

return __pte(val);
}


#endif /* __ASSEMBLY__ */

#ifdef CONFIG_X86_32
Expand Down
16 changes: 0 additions & 16 deletions trunk/include/asm-x86/pgtable_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,22 +235,6 @@ static inline void clone_pgd_range(pgd_t *dst, pgd_t *src, int count)

#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))

static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
{
pte.pte_low &= _PAGE_CHG_MASK;
pte.pte_low |= pgprot_val(newprot);
#ifdef CONFIG_X86_PAE
/*
* Chop off the NX bit (if present), and add the NX portion of
* the newprot (if present):
*/
pte.pte_high &= ~(1 << (_PAGE_BIT_NX - 32));
pte.pte_high |= (pgprot_val(newprot) >> 32) & \
(__supported_pte_mask >> 32);
#endif
return pte;
}

/*
* the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD]
*
Expand Down

0 comments on commit a8ede27

Please sign in to comment.