diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2008-01-30 07:34:04 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:34:04 -0500 |
commit | 30551bb3ce9257a2352b3cb4e45010d415cc0ad5 (patch) | |
tree | edcf2a24fc689ecb4a0420c0d555d042002ecacf /arch/x86/mm/pageattr.c | |
parent | 0a663088cd6ff9e89f285ae7689e6eee46cfb54c (diff) |
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.c | 9 |
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) | |||
28 | pud_t *pud; | 28 | pud_t *pud; |
29 | pmd_t *pmd; | 29 | pmd_t *pmd; |
30 | 30 | ||
31 | *level = PG_LEVEL_NONE; | ||
32 | |||
31 | if (pgd_none(*pgd)) | 33 | if (pgd_none(*pgd)) |
32 | return NULL; | 34 | return NULL; |
33 | pud = pud_offset(pgd, address); | 35 | pud = pud_offset(pgd, address); |
@@ -36,11 +38,12 @@ pte_t *lookup_address(unsigned long address, int *level) | |||
36 | pmd = pmd_offset(pud, address); | 38 | pmd = pmd_offset(pud, address); |
37 | if (pmd_none(*pmd)) | 39 | if (pmd_none(*pmd)) |
38 | return NULL; | 40 | return NULL; |
39 | *level = 3; | 41 | |
42 | *level = PG_LEVEL_2M; | ||
40 | if (pmd_large(*pmd)) | 43 | if (pmd_large(*pmd)) |
41 | return (pte_t *)pmd; | 44 | return (pte_t *)pmd; |
42 | *level = 4; | ||
43 | 45 | ||
46 | *level = PG_LEVEL_4K; | ||
44 | return pte_offset_kernel(pmd, address); | 47 | return pte_offset_kernel(pmd, address); |
45 | } | 48 | } |
46 | 49 | ||
@@ -145,7 +148,7 @@ repeat: | |||
145 | address < (unsigned long)&_etext && | 148 | address < (unsigned long)&_etext && |
146 | (pgprot_val(prot) & _PAGE_NX)); | 149 | (pgprot_val(prot) & _PAGE_NX)); |
147 | 150 | ||
148 | if (level == 4) { | 151 | if (level == PG_LEVEL_4K) { |
149 | set_pte_atomic(kpte, mk_pte(page, canon_pgprot(prot))); | 152 | set_pte_atomic(kpte, mk_pte(page, canon_pgprot(prot))); |
150 | } else { | 153 | } else { |
151 | err = split_large_page(kpte, address); | 154 | err = split_large_page(kpte, address); |