提交 c3c2fee3 编写于 作者: J Jeremy Fitzhardinge 提交者: Ingo Molnar

x86: unify mmu_context.h

Some amount of asm-x86/mmu_context.h can be unified, including
activate_mm paravirt hook.
Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 fb15a9b3
#ifndef __ASM_X86_MMU_CONTEXT_H
#define __ASM_X86_MMU_CONTEXT_H
#include <asm/desc.h>
#include <asm/atomic.h>
#include <asm/pgalloc.h>
#include <asm/tlbflush.h>
#include <asm/paravirt.h>
#ifndef CONFIG_PARAVIRT
#include <asm-generic/mm_hooks.h>
static inline void paravirt_activate_mm(struct mm_struct *prev,
struct mm_struct *next)
{
}
#endif /* !CONFIG_PARAVIRT */
/*
* Used for LDT copy/destruction.
*/
int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
void destroy_context(struct mm_struct *mm);
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
# include "mmu_context_32.h" # include "mmu_context_32.h"
#else #else
# include "mmu_context_64.h" # include "mmu_context_64.h"
#endif #endif
#define activate_mm(prev, next) \
do { \
paravirt_activate_mm((prev), (next)); \
switch_mm((prev), (next), NULL); \
} while (0);
#endif /* __ASM_X86_MMU_CONTEXT_H */
#ifndef __I386_SCHED_H #ifndef __I386_SCHED_H
#define __I386_SCHED_H #define __I386_SCHED_H
#include <asm/desc.h>
#include <asm/atomic.h>
#include <asm/pgalloc.h>
#include <asm/tlbflush.h>
#include <asm/paravirt.h>
#ifndef CONFIG_PARAVIRT
#include <asm-generic/mm_hooks.h>
static inline void paravirt_activate_mm(struct mm_struct *prev,
struct mm_struct *next)
{
}
#endif /* !CONFIG_PARAVIRT */
/*
* Used for LDT copy/destruction.
*/
int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
void destroy_context(struct mm_struct *mm);
static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{ {
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
...@@ -75,10 +53,4 @@ static inline void switch_mm(struct mm_struct *prev, ...@@ -75,10 +53,4 @@ static inline void switch_mm(struct mm_struct *prev,
#define deactivate_mm(tsk, mm) \ #define deactivate_mm(tsk, mm) \
asm("movl %0,%%gs": :"r" (0)); asm("movl %0,%%gs": :"r" (0));
#define activate_mm(prev, next) \
do { \
paravirt_activate_mm((prev), (next)); \
switch_mm((prev), (next), NULL); \
} while (0);
#endif #endif
#ifndef __X86_64_MMU_CONTEXT_H #ifndef __X86_64_MMU_CONTEXT_H
#define __X86_64_MMU_CONTEXT_H #define __X86_64_MMU_CONTEXT_H
#include <asm/desc.h>
#include <asm/atomic.h>
#include <asm/pgalloc.h>
#include <asm/pda.h> #include <asm/pda.h>
#include <asm/pgtable.h>
#include <asm/tlbflush.h>
#ifndef CONFIG_PARAVIRT
#include <asm-generic/mm_hooks.h>
#endif
/*
* possibly do the LDT unload here?
*/
int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
void destroy_context(struct mm_struct *mm);
static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{ {
...@@ -65,8 +51,4 @@ do { \ ...@@ -65,8 +51,4 @@ do { \
asm volatile("movl %0,%%fs"::"r"(0)); \ asm volatile("movl %0,%%fs"::"r"(0)); \
} while (0) } while (0)
#define activate_mm(prev, next) \
switch_mm((prev), (next), NULL)
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册