1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_SH_MMU_CONTEXT_32_H
3 #define __ASM_SH_MMU_CONTEXT_32_H
6 * Destroy context related info for an mm_struct that is about
9 static inline void destroy_context(struct mm_struct
*mm
)
14 #ifdef CONFIG_CPU_HAS_PTEAEX
15 static inline void set_asid(unsigned long asid
)
17 __raw_writel(asid
, MMU_PTEAEX
);
20 static inline unsigned long get_asid(void)
22 return __raw_readl(MMU_PTEAEX
) & MMU_CONTEXT_ASID_MASK
;
25 static inline void set_asid(unsigned long asid
)
27 unsigned long __dummy
;
29 __asm__
__volatile__ ("mov.l %2, %0\n\t"
34 : "r" (asid
), "m" (__m(MMU_PTEH
)),
38 static inline unsigned long get_asid(void)
42 __asm__
__volatile__ ("mov.l %1, %0"
44 : "m" (__m(MMU_PTEH
)));
45 asid
&= MMU_CONTEXT_ASID_MASK
;
48 #endif /* CONFIG_CPU_HAS_PTEAEX */
50 /* MMU_TTB is used for optimizing the fault handling. */
51 static inline void set_TTB(pgd_t
*pgd
)
53 __raw_writel((unsigned long)pgd
, MMU_TTB
);
56 static inline pgd_t
*get_TTB(void)
58 return (pgd_t
*)__raw_readl(MMU_TTB
);
60 #endif /* __ASM_SH_MMU_CONTEXT_32_H */