aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/pgtable.h
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2009-09-19 00:11:26 -0400
committerLen Brown <len.brown@intel.com>2009-09-19 00:11:26 -0400
commitc602c65b2f81d14456771d1e3f15d1381f4b7efa (patch)
treef1f833c8dd6c1519eeb101be32f7fe54a9605af5 /arch/x86/include/asm/pgtable.h
parent3834f47291df475be3f0f0fb7ccaa098967cc054 (diff)
parent78f28b7c555359c67c2a0d23f7436e915329421e (diff)
Merge branch 'linus' into sfi-release
Conflicts: arch/x86/kernel/setup.c drivers/acpi/power.c init/main.c Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch/x86/include/asm/pgtable.h')
-rw-r--r--arch/x86/include/asm/pgtable.h26
1 files changed, 8 insertions, 18 deletions
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 16748077559a..af6fd360ab35 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -56,16 +56,6 @@ extern struct list_head pgd_list;
56#define pte_update(mm, addr, ptep) do { } while (0) 56#define pte_update(mm, addr, ptep) do { } while (0)
57#define pte_update_defer(mm, addr, ptep) do { } while (0) 57#define pte_update_defer(mm, addr, ptep) do { } while (0)
58 58
59static inline void __init paravirt_pagetable_setup_start(pgd_t *base)
60{
61 native_pagetable_setup_start(base);
62}
63
64static inline void __init paravirt_pagetable_setup_done(pgd_t *base)
65{
66 native_pagetable_setup_done(base);
67}
68
69#define pgd_val(x) native_pgd_val(x) 59#define pgd_val(x) native_pgd_val(x)
70#define __pgd(x) native_make_pgd(x) 60#define __pgd(x) native_make_pgd(x)
71 61
@@ -135,6 +125,11 @@ static inline unsigned long pte_pfn(pte_t pte)
135 return (pte_val(pte) & PTE_PFN_MASK) >> PAGE_SHIFT; 125 return (pte_val(pte) & PTE_PFN_MASK) >> PAGE_SHIFT;
136} 126}
137 127
128static inline unsigned long pmd_pfn(pmd_t pmd)
129{
130 return (pmd_val(pmd) & PTE_PFN_MASK) >> PAGE_SHIFT;
131}
132
138#define pte_page(pte) pfn_to_page(pte_pfn(pte)) 133#define pte_page(pte) pfn_to_page(pte_pfn(pte))
139 134
140static inline int pmd_large(pmd_t pte) 135static inline int pmd_large(pmd_t pte)
@@ -359,7 +354,7 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd)
359 * this macro returns the index of the entry in the pmd page which would 354 * this macro returns the index of the entry in the pmd page which would
360 * control the given virtual address 355 * control the given virtual address
361 */ 356 */
362static inline unsigned pmd_index(unsigned long address) 357static inline unsigned long pmd_index(unsigned long address)
363{ 358{
364 return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1); 359 return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1);
365} 360}
@@ -379,7 +374,7 @@ static inline unsigned pmd_index(unsigned long address)
379 * this function returns the index of the entry in the pte page which would 374 * this function returns the index of the entry in the pte page which would
380 * control the given virtual address 375 * control the given virtual address
381 */ 376 */
382static inline unsigned pte_index(unsigned long address) 377static inline unsigned long pte_index(unsigned long address)
383{ 378{
384 return (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1); 379 return (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
385} 380}
@@ -430,11 +425,6 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
430 return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address); 425 return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address);
431} 426}
432 427
433static inline unsigned long pmd_pfn(pmd_t pmd)
434{
435 return (pmd_val(pmd) & PTE_PFN_MASK) >> PAGE_SHIFT;
436}
437
438static inline int pud_large(pud_t pud) 428static inline int pud_large(pud_t pud)
439{ 429{
440 return (pud_val(pud) & (_PAGE_PSE | _PAGE_PRESENT)) == 430 return (pud_val(pud) & (_PAGE_PSE | _PAGE_PRESENT)) ==
@@ -470,7 +460,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd)
470#define pgd_page(pgd) pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT) 460#define pgd_page(pgd) pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT)
471 461
472/* to find an entry in a page-table-directory. */ 462/* to find an entry in a page-table-directory. */
473static inline unsigned pud_index(unsigned long address) 463static inline unsigned long pud_index(unsigned long address)
474{ 464{
475 return (address >> PUD_SHIFT) & (PTRS_PER_PUD - 1); 465 return (address >> PUD_SHIFT) & (PTRS_PER_PUD - 1);
476} 466}