Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 1 | #ifndef __SPARC_MMU_CONTEXT_H |
| 2 | #define __SPARC_MMU_CONTEXT_H |
| 3 | |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 4 | #ifndef __ASSEMBLY__ |
| 5 | |
| 6 | #include <asm-generic/mm_hooks.h> |
| 7 | |
| 8 | static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) |
| 9 | { |
| 10 | } |
| 11 | |
| 12 | /* |
| 13 | * Initialize a new mmu context. This is invoked when a new |
| 14 | * address space instance (unique or shared) is instantiated. |
| 15 | */ |
| 16 | #define init_new_context(tsk, mm) (((mm)->context = NO_CONTEXT), 0) |
| 17 | |
| 18 | /* |
| 19 | * Destroy a dead context. This occurs when mmput drops the |
| 20 | * mm_users count to zero, the mmaps have been released, and |
| 21 | * all the page tables have been flushed. Our job is to destroy |
| 22 | * any remaining processor-specific state. |
| 23 | */ |
Sam Ravnborg | b796c6d | 2012-05-13 10:30:54 +0200 | [diff] [blame] | 24 | void destroy_context(struct mm_struct *mm); |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 25 | |
| 26 | /* Switch the current MM context. */ |
Sam Ravnborg | 34d4acc | 2012-05-12 08:04:11 +0000 | [diff] [blame] | 27 | void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, |
| 28 | struct task_struct *tsk); |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 29 | |
| 30 | #define deactivate_mm(tsk,mm) do { } while (0) |
| 31 | |
| 32 | /* Activate a new MM instance for the current task. */ |
| 33 | #define activate_mm(active_mm, mm) switch_mm((active_mm), (mm), NULL) |
| 34 | |
| 35 | #endif /* !(__ASSEMBLY__) */ |
| 36 | |
| 37 | #endif /* !(__SPARC_MMU_CONTEXT_H) */ |