Skip to content

Commit

Permalink
x86: unify pud_large
Browse files Browse the repository at this point in the history
Impact: cleanup

Unify and demacro pud_large.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
  • Loading branch information
Jeremy Fitzhardinge committed Feb 6, 2009
1 parent 3fbc244 commit 3f6cbef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 6 additions & 0 deletions arch/x86/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,12 @@ static inline unsigned long pmd_pfn(pmd_t pmd)
{
return (pmd_val(pmd) & PTE_PFN_MASK) >> PAGE_SHIFT;
}

static inline int pud_large(pud_t pud)
{
return (pud_val(pud) & (_PAGE_PSE | _PAGE_PRESENT)) ==
(_PAGE_PSE | _PAGE_PRESENT);
}
#endif /* PAGETABLE_LEVELS > 2 */

#if PAGETABLE_LEVELS > 3
Expand Down
2 changes: 0 additions & 2 deletions arch/x86/include/asm/pgtable_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ extern unsigned long pg0[];
# include <asm/pgtable-2level.h>
#endif

static inline int pud_large(pud_t pud) { return 0; }

#if defined(CONFIG_HIGHPTE)
#define pte_offset_map(dir, address) \
((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), KM_PTE0) + \
Expand Down
6 changes: 0 additions & 6 deletions arch/x86/include/asm/pgtable_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,6 @@ static inline int pgd_large(pgd_t pgd) { return 0; }

/* PUD - Level3 access */

static inline int pud_large(pud_t pte)
{
return (pud_val(pte) & (_PAGE_PSE | _PAGE_PRESENT)) ==
(_PAGE_PSE | _PAGE_PRESENT);
}

/* PMD - Level 2 access */
#define pte_to_pgoff(pte) ((pte_val((pte)) & PHYSICAL_PAGE_MASK) >> PAGE_SHIFT)
#define pgoff_to_pte(off) ((pte_t) { .pte = ((off) << PAGE_SHIFT) | \
Expand Down

0 comments on commit 3f6cbef

Please sign in to comment.