summaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/pageattr.c
diff options
context:
space:
mode:
authorThomas Gleixner2008-01-30 13:34:04 +0100
committerIngo Molnar2008-01-30 13:34:04 +0100
commit30551bb3ce9257a2352b3cb4e45010d415cc0ad5 (patch)
treeedcf2a24fc689ecb4a0420c0d555d042002ecacf /arch/x86/mm/pageattr.c
parentx86: clean up lookup_address() declarations (diff)
downloadkernel-qcow2-linux-30551bb3ce9257a2352b3cb4e45010d415cc0ad5.tar.gz
kernel-qcow2-linux-30551bb3ce9257a2352b3cb4e45010d415cc0ad5.tar.xz
kernel-qcow2-linux-30551bb3ce9257a2352b3cb4e45010d415cc0ad5.zip
x86: add PG_LEVEL enum
this way PG_LEVEL_1GB will be an easy change. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/pageattr.c')
-rw-r--r--arch/x86/mm/pageattr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index a270f9ccebfb..4589a1382fa1 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -28,6 +28,8 @@ pte_t *lookup_address(unsigned long address, int *level)
pud_t *pud;
pmd_t *pmd;
+ *level = PG_LEVEL_NONE;
+
if (pgd_none(*pgd))
return NULL;
pud = pud_offset(pgd, address);
@@ -36,11 +38,12 @@ pte_t *lookup_address(unsigned long address, int *level)
pmd = pmd_offset(pud, address);
if (pmd_none(*pmd))
return NULL;
- *level = 3;
+
+ *level = PG_LEVEL_2M;
if (pmd_large(*pmd))
return (pte_t *)pmd;
- *level = 4;
+ *level = PG_LEVEL_4K;
return pte_offset_kernel(pmd, address);
}
@@ -145,7 +148,7 @@ repeat:
address < (unsigned long)&_etext &&
(pgprot_val(prot) & _PAGE_NX));
- if (level == 4) {
+ if (level == PG_LEVEL_4K) {
set_pte_atomic(kpte, mk_pte(page, canon_pgprot(prot)));
} else {
err = split_large_page(kpte, address);