diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-11-09 02:37:18 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-01-27 23:18:41 -0500 |
commit | cdcc970829e81da3445346cb71b2ea264c9952b9 (patch) | |
tree | 0a82de87d6b2d8b86d8b5badd58daec44b026d68 /include/asm-sh/mmu_context_32.h | |
parent | 9085fa1255fc16bf0dbd217e9f4cdccf16f064d3 (diff) |
sh: Move in the SH-5 mmu_context headers.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh/mmu_context_32.h')
-rw-r--r-- | include/asm-sh/mmu_context_32.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/include/asm-sh/mmu_context_32.h b/include/asm-sh/mmu_context_32.h new file mode 100644 index 000000000000..f4f9aebd68b7 --- /dev/null +++ b/include/asm-sh/mmu_context_32.h | |||
@@ -0,0 +1,47 @@ | |||
1 | #ifndef __ASM_SH_MMU_CONTEXT_32_H | ||
2 | #define __ASM_SH_MMU_CONTEXT_32_H | ||
3 | |||
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) | ||
9 | { | ||
10 | /* Do nothing */ | ||
11 | } | ||
12 | |||
13 | static inline void set_asid(unsigned long asid) | ||
14 | { | ||
15 | unsigned long __dummy; | ||
16 | |||
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)); | ||
24 | } | ||
25 | |||
26 | static inline unsigned long get_asid(void) | ||
27 | { | ||
28 | unsigned long asid; | ||
29 | |||
30 | __asm__ __volatile__ ("mov.l %1, %0" | ||
31 | : "=r" (asid) | ||
32 | : "m" (__m(MMU_PTEH))); | ||
33 | asid &= MMU_CONTEXT_ASID_MASK; | ||
34 | return asid; | ||
35 | } | ||
36 | |||
37 | /* MMU_TTB is used for optimizing the fault handling. */ | ||
38 | static inline void set_TTB(pgd_t *pgd) | ||
39 | { | ||
40 | ctrl_outl((unsigned long)pgd, MMU_TTB); | ||
41 | } | ||
42 | |||
43 | static inline pgd_t *get_TTB(void) | ||
44 | { | ||
45 | return (pgd_t *)ctrl_inl(MMU_TTB); | ||
46 | } | ||
47 | #endif /* __ASM_SH_MMU_CONTEXT_32_H */ | ||