Skip to content

Commit

Permalink
x86: define pud_flags and pud_large properly to allow non-PAE builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Fitzhardinge authored and Jeremy Fitzhardinge committed Feb 11, 2009
1 parent e42778d commit e2f5bda
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions arch/x86/include/asm/page_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ static inline pudval_t native_pud_val(pud_t pud)
#if PAGETABLE_LEVELS > 2
typedef struct { pmdval_t pmd; } pmd_t;

static inline pudval_t pud_flags(pud_t pud)
{
return native_pud_val(pud) & PTE_FLAGS_MASK;
}

static inline pmd_t native_make_pmd(pmdval_t val)
{
return (pmd_t) { val };
Expand All @@ -113,6 +108,11 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
}
#endif

static inline pudval_t pud_flags(pud_t pud)
{
return native_pud_val(pud) & PTE_FLAGS_MASK;
}

static inline pmdval_t pmd_flags(pmd_t pmd)
{
return native_pmd_val(pmd) & PTE_FLAGS_MASK;
Expand Down
7 changes: 6 additions & 1 deletion arch/x86/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,19 @@ static inline unsigned long pmd_pfn(pmd_t pmd)

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

static inline int pud_bad(pud_t pud)
{
return (pud_flags(pud) & ~(_KERNPG_TABLE | _PAGE_USER)) != 0;
}
#else
static inline int pud_large(pud_t pud)
{
return 0;
}
#endif /* PAGETABLE_LEVELS > 2 */

#if PAGETABLE_LEVELS > 3
Expand Down

0 comments on commit e2f5bda

Please sign in to comment.