OSDN Git Service

sparc32: Add pmd_pfn()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 15 Feb 2022 22:50:17 +0000 (17:50 -0500)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 21 Mar 2022 16:59:02 +0000 (12:59 -0400)
We need to use this function in common code; pull it out of pmd_page().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
arch/sparc/include/asm/pgtable_32.h

index ffccfe3..4866625 100644 (file)
@@ -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)