blob: 2df2a9be8f6de95ad1fc61dbedc2366e14ec5406 [file] [log] [blame]
Sam Ravnborgf5e706a2008-07-17 21:55:51 -07001#ifndef __SPARC_MMU_CONTEXT_H
2#define __SPARC_MMU_CONTEXT_H
3
Sam Ravnborgf5e706a2008-07-17 21:55:51 -07004#ifndef __ASSEMBLY__
5
6#include <asm-generic/mm_hooks.h>
7
8static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
9{
10}
11
Sam Ravnborgb585e852012-07-26 11:02:24 +000012/* Initialize a new mmu context. This is invoked when a new
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070013 * address space instance (unique or shared) is instantiated.
14 */
Sam Ravnborgb585e852012-07-26 11:02:24 +000015int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070016
Sam Ravnborgb585e852012-07-26 11:02:24 +000017/* Destroy a dead context. This occurs when mmput drops the
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070018 * mm_users count to zero, the mmaps have been released, and
19 * all the page tables have been flushed. Our job is to destroy
20 * any remaining processor-specific state.
21 */
Sam Ravnborgb796c6d2012-05-13 10:30:54 +020022void destroy_context(struct mm_struct *mm);
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070023
24/* Switch the current MM context. */
Sam Ravnborg34d4acc2012-05-12 08:04:11 +000025void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm,
26 struct task_struct *tsk);
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070027
28#define deactivate_mm(tsk,mm) do { } while (0)
29
30/* Activate a new MM instance for the current task. */
31#define activate_mm(active_mm, mm) switch_mm((active_mm), (mm), NULL)
32
33#endif /* !(__ASSEMBLY__) */
34
35#endif /* !(__SPARC_MMU_CONTEXT_H) */