1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2a439fe51SSam Ravnborg #ifndef __SPARC_MMU_CONTEXT_H 3a439fe51SSam Ravnborg #define __SPARC_MMU_CONTEXT_H 4a439fe51SSam Ravnborg 5a439fe51SSam Ravnborg #ifndef __ASSEMBLY__ 6a439fe51SSam Ravnborg 7a439fe51SSam Ravnborg #include <asm-generic/mm_hooks.h> 8a439fe51SSam Ravnborg 9a439fe51SSam Ravnborg static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) 10a439fe51SSam Ravnborg { 11a439fe51SSam Ravnborg } 12a439fe51SSam Ravnborg 13b585e855SSam Ravnborg /* Initialize a new mmu context. This is invoked when a new 14a439fe51SSam Ravnborg * address space instance (unique or shared) is instantiated. 15a439fe51SSam Ravnborg */ 16b585e855SSam Ravnborg int init_new_context(struct task_struct *tsk, struct mm_struct *mm); 17a439fe51SSam Ravnborg 18b585e855SSam Ravnborg /* Destroy a dead context. This occurs when mmput drops the 19a439fe51SSam Ravnborg * mm_users count to zero, the mmaps have been released, and 20a439fe51SSam Ravnborg * all the page tables have been flushed. Our job is to destroy 21a439fe51SSam Ravnborg * any remaining processor-specific state. 22a439fe51SSam Ravnborg */ 23b796c6daSSam Ravnborg void destroy_context(struct mm_struct *mm); 24a439fe51SSam Ravnborg 25a439fe51SSam Ravnborg /* Switch the current MM context. */ 2634d4accfSSam Ravnborg void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, 2734d4accfSSam Ravnborg struct task_struct *tsk); 28a439fe51SSam Ravnborg 29a439fe51SSam Ravnborg #define deactivate_mm(tsk,mm) do { } while (0) 30a439fe51SSam Ravnborg 31a439fe51SSam Ravnborg /* Activate a new MM instance for the current task. */ 32a439fe51SSam Ravnborg #define activate_mm(active_mm, mm) switch_mm((active_mm), (mm), NULL) 33a439fe51SSam Ravnborg 34a439fe51SSam Ravnborg #endif /* !(__ASSEMBLY__) */ 35a439fe51SSam Ravnborg 36a439fe51SSam Ravnborg #endif /* !(__SPARC_MMU_CONTEXT_H) */ 37