1b2441318SGreg 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 9b585e855SSam Ravnborg /* Initialize a new mmu context. This is invoked when a new 10a439fe51SSam Ravnborg * address space instance (unique or shared) is instantiated. 11a439fe51SSam Ravnborg */ 12*ca0f34b5SNicholas Piggin #define init_new_context init_new_context 13b585e855SSam Ravnborg int init_new_context(struct task_struct *tsk, struct mm_struct *mm); 14a439fe51SSam Ravnborg 15b585e855SSam Ravnborg /* Destroy a dead context. This occurs when mmput drops the 16a439fe51SSam Ravnborg * mm_users count to zero, the mmaps have been released, and 17a439fe51SSam Ravnborg * all the page tables have been flushed. Our job is to destroy 18a439fe51SSam Ravnborg * any remaining processor-specific state. 19a439fe51SSam Ravnborg */ 20*ca0f34b5SNicholas Piggin #define destroy_context destroy_context 21b796c6daSSam Ravnborg void destroy_context(struct mm_struct *mm); 22a439fe51SSam Ravnborg 23a439fe51SSam Ravnborg /* Switch the current MM context. */ 2434d4accfSSam Ravnborg void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, 2534d4accfSSam Ravnborg struct task_struct *tsk); 26a439fe51SSam Ravnborg 27a439fe51SSam Ravnborg /* Activate a new MM instance for the current task. */ 28a439fe51SSam Ravnborg #define activate_mm(active_mm, mm) switch_mm((active_mm), (mm), NULL) 29a439fe51SSam Ravnborg 30*ca0f34b5SNicholas Piggin #include <asm-generic/mmu_context.h> 31*ca0f34b5SNicholas Piggin 32a439fe51SSam Ravnborg #endif /* !(__ASSEMBLY__) */ 33a439fe51SSam Ravnborg 34a439fe51SSam Ravnborg #endif /* !(__SPARC_MMU_CONTEXT_H) */ 35