mm: introduce get_user_pages_fast
[linux/fpc-iii.git] / include / asm-sh / mmu_context_32.h
blobf4f9aebd68b797a7df2d9005af2e6e3ad0b4d58f
1 #ifndef __ASM_SH_MMU_CONTEXT_32_H
2 #define __ASM_SH_MMU_CONTEXT_32_H
4 /*
5 * Destroy context related info for an mm_struct that is about
6 * to be put to rest.
7 */
8 static inline void destroy_context(struct mm_struct *mm)
10 /* Do nothing */
13 static inline void set_asid(unsigned long asid)
15 unsigned long __dummy;
17 __asm__ __volatile__ ("mov.l %2, %0\n\t"
18 "and %3, %0\n\t"
19 "or %1, %0\n\t"
20 "mov.l %0, %2"
21 : "=&r" (__dummy)
22 : "r" (asid), "m" (__m(MMU_PTEH)),
23 "r" (0xffffff00));
26 static inline unsigned long get_asid(void)
28 unsigned long asid;
30 __asm__ __volatile__ ("mov.l %1, %0"
31 : "=r" (asid)
32 : "m" (__m(MMU_PTEH)));
33 asid &= MMU_CONTEXT_ASID_MASK;
34 return asid;
37 /* MMU_TTB is used for optimizing the fault handling. */
38 static inline void set_TTB(pgd_t *pgd)
40 ctrl_outl((unsigned long)pgd, MMU_TTB);
43 static inline pgd_t *get_TTB(void)
45 return (pgd_t *)ctrl_inl(MMU_TTB);
47 #endif /* __ASM_SH_MMU_CONTEXT_32_H */