aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/pgtable.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-02-09 05:42:57 -0500
committerIngo Molnar <mingo@elte.hu>2009-02-09 05:42:57 -0500
commite5f7f202f31fd05e9de7e1ba5a7b30de7855f5aa (patch)
tree198a2f0e82dc008d371b12eb422a66be96d4924c /arch/x86/include/asm/pgtable.h
parent726c0d95b6bd06cb83efd36a76ccf03fa9a770f0 (diff)
x86, pgtable.h: macro-ify *_page() methods
The p?d_page() methods still rely on highlevel types and methods: In file included from arch/x86/kernel/early_printk.c:18: /home/mingo/tip/arch/x86/include/asm/pgtable.h: In function ‘pmd_page’: /home/mingo/tip/arch/x86/include/asm/pgtable.h:516: error: implicit declaration of function ‘__pfn_to_section’ /home/mingo/tip/arch/x86/include/asm/pgtable.h:516: error: initialization makes pointer from integer without a cast /home/mingo/tip/arch/x86/include/asm/pgtable.h:516: error: implicit declaration of function ‘__section_mem_map_addr’ /home/mingo/tip/arch/x86/include/asm/pgtable.h:516: error: return makes pointer from integer without a cast So convert them to macros and document the type dependency. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/pgtable.h')
-rw-r--r--arch/x86/include/asm/pgtable.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index a80a956ae655..76696e98f5b3 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -473,10 +473,11 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd)
473 return (unsigned long)__va(pmd_val(pmd) & PTE_PFN_MASK); 473 return (unsigned long)__va(pmd_val(pmd) & PTE_PFN_MASK);
474} 474}
475 475
476static inline struct page *pmd_page(pmd_t pmd) 476/*
477{ 477 * Currently stuck as a macro due to indirect forward reference to
478 return pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT); 478 * linux/mmzone.h's __section_mem_map_addr() definition:
479} 479 */
480#define pmd_page(pmd) pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)
480 481
481/* 482/*
482 * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD] 483 * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD]
@@ -543,10 +544,11 @@ static inline unsigned long pud_page_vaddr(pud_t pud)
543 return (unsigned long)__va((unsigned long)pud_val(pud) & PTE_PFN_MASK); 544 return (unsigned long)__va((unsigned long)pud_val(pud) & PTE_PFN_MASK);
544} 545}
545 546
546static inline struct page *pud_page(pud_t pud) 547/*
547{ 548 * Currently stuck as a macro due to indirect forward reference to
548 return pfn_to_page(pud_val(pud) >> PAGE_SHIFT); 549 * linux/mmzone.h's __section_mem_map_addr() definition:
549} 550 */
551#define pud_page(pud) pfn_to_page(pud_val(pud) >> PAGE_SHIFT)
550 552
551/* Find an entry in the second-level page table.. */ 553/* Find an entry in the second-level page table.. */
552static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address) 554static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
@@ -582,10 +584,11 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd)
582 return (unsigned long)__va((unsigned long)pgd_val(pgd) & PTE_PFN_MASK); 584 return (unsigned long)__va((unsigned long)pgd_val(pgd) & PTE_PFN_MASK);
583} 585}
584 586
585static inline struct page *pgd_page(pgd_t pgd) 587/*
586{ 588 * Currently stuck as a macro due to indirect forward reference to
587 return pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT); 589 * linux/mmzone.h's __section_mem_map_addr() definition:
588} 590 */
591#define pgd_page(pgd) pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT)
589 592
590/* to find an entry in a page-table-directory. */ 593/* to find an entry in a page-table-directory. */
591static inline unsigned pud_index(unsigned long address) 594static inline unsigned pud_index(unsigned long address)