1 #ifndef __PARISC_MMU_CONTEXT_H
2 #define __PARISC_MMU_CONTEXT_H
4 #include <asm/pgalloc.h>
6 static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
10 /* on PA-RISC, we actually have enough contexts to justify an allocator
13 extern unsigned long alloc_sid(void);
14 extern void free_sid(unsigned long);
17 init_new_context(struct task_struct *tsk, struct mm_struct *mm)
19 if (atomic_read(&mm->mm_users) != 1)
22 mm->context = alloc_sid();
27 destroy_context(struct mm_struct *mm)
29 free_sid(mm->context);
33 static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk, unsigned cpu)
37 mtctl(__pa(next->pgd), 25);
38 load_context(next->context);
42 static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
45 * Activate_mm is our one chance to allocate a space id
46 * for a new mm created in the exec path. There's also
47 * some lazy tlb stuff, which is currently dead code, but
48 * we only allocate a space id if one hasn't been allocated
49 * already, so we should be OK.
52 if (next == &init_mm) BUG(); /* Should never happen */
54 if (next->context == 0)
55 next->context = alloc_sid();
57 switch_mm(prev,next,current,0);