2019-08-25 10:49:19 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-16 15:20:36 -07:00
|
|
|
/*
|
2007-10-16 01:27:00 -07:00
|
|
|
* Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
|
2005-04-16 15:20:36 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __UM_MMU_CONTEXT_H
|
|
|
|
#define __UM_MMU_CONTEXT_H
|
|
|
|
|
2011-08-18 20:09:09 +01:00
|
|
|
#include <linux/sched.h>
|
2017-02-04 00:16:44 +01:00
|
|
|
#include <linux/mm_types.h>
|
2020-06-08 21:33:33 -07:00
|
|
|
#include <linux/mmap_lock.h>
|
2017-02-04 00:16:44 +01:00
|
|
|
|
2021-01-13 22:09:44 +01:00
|
|
|
#include <asm/mm_hooks.h>
|
2011-08-18 20:09:09 +01:00
|
|
|
#include <asm/mmu.h>
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2020-09-02 00:15:37 +10:00
|
|
|
#define activate_mm activate_mm
|
2005-04-16 15:20:36 -07:00
|
|
|
static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
|
|
|
|
struct task_struct *tsk)
|
|
|
|
{
|
|
|
|
unsigned cpu = smp_processor_id();
|
|
|
|
|
2025-07-11 14:50:21 +08:00
|
|
|
if (prev != next) {
|
2009-09-24 09:34:51 -06:00
|
|
|
cpumask_clear_cpu(cpu, mm_cpumask(prev));
|
|
|
|
cpumask_set_cpu(cpu, mm_cpumask(next));
|
2005-04-16 15:20:36 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-02 00:15:37 +10:00
|
|
|
#define init_new_context init_new_context
|
2007-10-16 01:26:58 -07:00
|
|
|
extern int init_new_context(struct task_struct *task, struct mm_struct *mm);
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2020-09-02 00:15:37 +10:00
|
|
|
#define destroy_context destroy_context
|
2007-10-16 01:26:58 -07:00
|
|
|
extern void destroy_context(struct mm_struct *mm);
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2020-09-02 00:15:37 +10:00
|
|
|
#include <asm-generic/mmu_context.h>
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
#endif
|