Files
linux-apfs/arch/um/include/asm/mmu_context.h
T

59 lines
1.3 KiB
C
Raw Normal View History

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
* Licensed under the GPL
*/
#ifndef __UM_MMU_CONTEXT_H
#define __UM_MMU_CONTEXT_H
#include <linux/sched.h>
#include <asm/mmu.h>
2005-04-16 15:20:36 -07:00
extern void uml_setup_stubs(struct mm_struct *mm);
2008-02-04 22:31:01 -08:00
extern void arch_exit_mmap(struct mm_struct *mm);
2005-04-16 15:20:36 -07:00
#define deactivate_mm(tsk,mm) do { } while (0)
2005-07-12 13:58:22 -07:00
extern void force_flush_all(void);
2005-04-16 15:20:36 -07:00
static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
{
/*
* This is called by fs/exec.c and sys_unshare()
* when the new ->mm is used for the first time.
*/
__switch_mm(&new->context.id);
down_write(&new->mmap_sem);
uml_setup_stubs(new);
up_write(&new->mmap_sem);
2005-04-16 15:20:36 -07:00
}
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
struct task_struct *tsk)
{
unsigned cpu = smp_processor_id();
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
if(next != &init_mm)
2007-10-16 01:27:06 -07:00
__switch_mm(&next->context.id);
2005-04-16 15:20:36 -07:00
}
}
static inline void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm)
{
uml_setup_stubs(mm);
}
2005-04-16 15:20:36 -07:00
static inline void enter_lazy_tlb(struct mm_struct *mm,
struct task_struct *tsk)
{
}
extern int init_new_context(struct task_struct *task, struct mm_struct *mm);
2005-04-16 15:20:36 -07:00
extern void destroy_context(struct mm_struct *mm);
2005-04-16 15:20:36 -07:00
#endif