~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/sh/include/asm/mmu_context_32.h

Version: ~ [ linux-5.12-rc7 ] ~ [ linux-5.11.13 ] ~ [ linux-5.10.29 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.111 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.186 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.230 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.266 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.266 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __ASM_SH_MMU_CONTEXT_32_H
  3 #define __ASM_SH_MMU_CONTEXT_32_H
  4 
  5 /*
  6  * Destroy context related info for an mm_struct that is about
  7  * to be put to rest.
  8  */
  9 static inline void destroy_context(struct mm_struct *mm)
 10 {
 11         /* Do nothing */
 12 }
 13 
 14 #ifdef CONFIG_CPU_HAS_PTEAEX
 15 static inline void set_asid(unsigned long asid)
 16 {
 17         __raw_writel(asid, MMU_PTEAEX);
 18 }
 19 
 20 static inline unsigned long get_asid(void)
 21 {
 22         return __raw_readl(MMU_PTEAEX) & MMU_CONTEXT_ASID_MASK;
 23 }
 24 #else
 25 static inline void set_asid(unsigned long asid)
 26 {
 27         unsigned long __dummy;
 28 
 29         __asm__ __volatile__ ("mov.l    %2, %0\n\t"
 30                               "and      %3, %0\n\t"
 31                               "or       %1, %0\n\t"
 32                               "mov.l    %0, %2"
 33                               : "=&r" (__dummy)
 34                               : "r" (asid), "m" (__m(MMU_PTEH)),
 35                                 "r" (0xffffff00));
 36 }
 37 
 38 static inline unsigned long get_asid(void)
 39 {
 40         unsigned long asid;
 41 
 42         __asm__ __volatile__ ("mov.l    %1, %0"
 43                               : "=r" (asid)
 44                               : "m" (__m(MMU_PTEH)));
 45         asid &= MMU_CONTEXT_ASID_MASK;
 46         return asid;
 47 }
 48 #endif /* CONFIG_CPU_HAS_PTEAEX */
 49 
 50 /* MMU_TTB is used for optimizing the fault handling. */
 51 static inline void set_TTB(pgd_t *pgd)
 52 {
 53         __raw_writel((unsigned long)pgd, MMU_TTB);
 54 }
 55 
 56 static inline pgd_t *get_TTB(void)
 57 {
 58         return (pgd_t *)__raw_readl(MMU_TTB);
 59 }
 60 #endif /* __ASM_SH_MMU_CONTEXT_32_H */
 61 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp