summaryrefslogtreecommitdiff
path: root/arch/sparc/include/asm/pgtable_32.h
diff options
context:
space:
mode:
authorWill Deacon <will@kernel.org>2020-04-14 22:40:10 +0100
committerDavid S. Miller <davem@davemloft.net>2020-05-13 15:32:00 -0700
commit3f407976ac2953116cb8880a7a18b63bcc81829d (patch)
treea6c8c04671658ba8deb6a6775cec51d25f02622a /arch/sparc/include/asm/pgtable_32.h
parent8e958839e4b9fb6ea4385ff2c52d1333a3a618de (diff)
sparc32: mm: Change pgtable_t type to pte_t * instead of struct page *
Change the 'pgtable_t' type for sparc32 so that it represents the uncached virtual address of the PTE table, rather than the underlying 'struct page'. This allows us to free page table allocations smaller than a page. Cc: "David S. Miller" <davem@davemloft.net> Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/include/asm/pgtable_32.h')
-rw-r--r--arch/sparc/include/asm/pgtable_32.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h
index 3367e2ba89e0..c5625b2aa331 100644
--- a/arch/sparc/include/asm/pgtable_32.h
+++ b/arch/sparc/include/asm/pgtable_32.h
@@ -135,6 +135,17 @@ static inline struct page *pmd_page(pmd_t pmd)
return pfn_to_page((pmd_val(pmd) & SRMMU_PTD_PMASK) >> (PAGE_SHIFT-4));
}
+static inline unsigned long __pmd_page(pmd_t pmd)
+{
+ unsigned long v;
+
+ if (srmmu_device_memory(pmd_val(pmd)))
+ BUG();
+
+ v = pmd_val(pmd) & SRMMU_PTD_PMASK;
+ return (unsigned long)__nocache_va(v << 4);
+}
+
static inline unsigned long pud_page_vaddr(pud_t pud)
{
if (srmmu_device_memory(pud_val(pud))) {