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