summaryrefslogtreecommitdiff
path: root/arch/arc/include/asm/mmu.h
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@kernel.org>2019-09-14 01:20:01 +0300
committerVineet Gupta <vgupta@kernel.org>2021-08-25 00:25:48 +0300
commit89d0d42412a116563c28c763d9c1bdee83b5b6af (patch)
treeb83d63611782632c2002ae30357cab5eb0343f7d /arch/arc/include/asm/mmu.h
parentbe43b096ed787bad9e1a74f79486159c6cd6e648 (diff)
downloadlinux-89d0d42412a116563c28c763d9c1bdee83b5b6af.tar.xz
ARC: mm: move MMU specific bits out of ASID allocator
And while at it, rewrite commentary on ASID allocator Signed-off-by: Vineet Gupta <vgupta@kernel.org>
Diffstat (limited to 'arch/arc/include/asm/mmu.h')
-rw-r--r--arch/arc/include/asm/mmu.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arc/include/asm/mmu.h b/arch/arc/include/asm/mmu.h
index 762cfe66e16b..c8b490175eae 100644
--- a/arch/arc/include/asm/mmu.h
+++ b/arch/arc/include/asm/mmu.h
@@ -64,6 +64,19 @@ typedef struct {
unsigned long asid[NR_CPUS]; /* 8 bit MMU PID + Generation cycle */
} mm_context_t;
+static inline void mmu_setup_asid(struct mm_struct *mm, unsigned int asid)
+{
+ write_aux_reg(ARC_REG_PID, asid | MMU_ENABLE);
+}
+
+static inline void mmu_setup_pgd(struct mm_struct *mm, void *pgd)
+{
+ /* PGD cached in MMU reg to avoid 3 mem lookups: task->mm->pgd */
+#ifdef CONFIG_ISA_ARCV2
+ write_aux_reg(ARC_REG_SCRATCH_DATA0, (unsigned int)pgd);
+#endif
+}
+
static inline int is_pae40_enabled(void)
{
return IS_ENABLED(CONFIG_ARC_HAS_PAE40);