aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-01-30 07:33:59 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:59 -0500
commita5f55035f63cf040b4a7161226ec35520cc10daa (patch)
tree14e7d58562413814326ec2df4b4b9a46d794f439
parentbbb09f5cfcde7e4cf1466111d671ac4a62931148 (diff)
x86: prepare for the unification of the cpa code
prepare for the unification of the cpa code, by unifying the lookup_address() logic between 32-bit and 64-bit. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/mm/pageattr_64.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/x86/mm/pageattr_64.c b/arch/x86/mm/pageattr_64.c
index 73dbbb4048e6..7b734ee5b7fd 100644
--- a/arch/x86/mm/pageattr_64.c
+++ b/arch/x86/mm/pageattr_64.c
@@ -19,26 +19,21 @@ pte_t *lookup_address(unsigned long address, int *level)
19 pgd_t *pgd = pgd_offset_k(address); 19 pgd_t *pgd = pgd_offset_k(address);
20 pud_t *pud; 20 pud_t *pud;
21 pmd_t *pmd; 21 pmd_t *pmd;
22 pte_t *pte;
23 22
24 if (pgd_none(*pgd)) 23 if (pgd_none(*pgd))
25 return NULL; 24 return NULL;
26 pud = pud_offset(pgd, address); 25 pud = pud_offset(pgd, address);
27 if (!pud_present(*pud)) 26 if (pud_none(*pud))
28 return NULL; 27 return NULL;
29 pmd = pmd_offset(pud, address); 28 pmd = pmd_offset(pud, address);
30 if (!pmd_present(*pmd)) 29 if (pmd_none(*pmd))
31 return NULL; 30 return NULL;
32 *level = 3; 31 *level = 3;
33 if (pmd_large(*pmd)) 32 if (pmd_large(*pmd))
34 return (pte_t *)pmd; 33 return (pte_t *)pmd;
35 *level = 4; 34 *level = 4;
36 35
37 pte = pte_offset_kernel(pmd, address); 36 return pte_offset_kernel(pmd, address);
38 if (pte && !pte_present(*pte))
39 pte = NULL;
40
41 return pte;
42} 37}
43 38
44static struct page * 39static struct page *