diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-02-16 01:50:17 +0300 |
---|---|---|
committer | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-03-21 19:59:02 +0300 |
commit | aef13dec0a5fa3c4adc8949307fc8d8aac7337df (patch) | |
tree | 83cbafa011f747b0bd791eb8a0b68f3e638e72da /arch/sparc | |
parent | 9e996c2115e1b52e235261121f7c9c121262dda9 (diff) | |
download | linux-aef13dec0a5fa3c4adc8949307fc8d8aac7337df.tar.xz |
sparc32: Add pmd_pfn()
We need to use this function in common code; pull it out of pmd_page().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/pgtable_32.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h index ffccfe3b22ed..4866625da314 100644 --- a/arch/sparc/include/asm/pgtable_32.h +++ b/arch/sparc/include/asm/pgtable_32.h @@ -127,11 +127,16 @@ static inline int srmmu_device_memory(unsigned long x) return ((x & 0xF0000000) != 0); } +static inline unsigned long pmd_pfn(pmd_t pmd) +{ + return (pmd_val(pmd) & SRMMU_PTD_PMASK) >> (PAGE_SHIFT-4); +} + static inline struct page *pmd_page(pmd_t pmd) { if (srmmu_device_memory(pmd_val(pmd))) BUG(); - return pfn_to_page((pmd_val(pmd) & SRMMU_PTD_PMASK) >> (PAGE_SHIFT-4)); + return pfn_to_page(pmd_pfn(pmd)); } static inline unsigned long __pmd_page(pmd_t pmd) |