diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-30 13:31:08 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 13:31:08 +0100 |
commit | 0a3b4d151a8e57f50ce5a12c7ea5ec9965cf0b5a (patch) | |
tree | d052ba5e4b35484a78d613d3af42e4026b2fc192 /include/asm-x86/system_32.h | |
parent | 833d8469b102365f427f7791e79ec1843ff5f164 (diff) |
x86: move switch_to macro to system.h
This patch moves the switch_to() macro to system.h
As those macros are fundamentally different between i386 and x86_64,
they are enclosed around an ifdef.
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/system_32.h')
-rw-r--r-- | include/asm-x86/system_32.h | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/include/asm-x86/system_32.h b/include/asm-x86/system_32.h index 7da0716fb31..83af46443bd 100644 --- a/include/asm-x86/system_32.h +++ b/include/asm-x86/system_32.h @@ -5,37 +5,6 @@ #include <asm/cpufeature.h> #include <asm/cmpxchg.h> -#ifdef __KERNEL__ -#define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */ - -struct task_struct; /* one of the stranger aspects of C forward declarations.. */ -extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next)); - -/* - * Saving eflags is important. It switches not only IOPL between tasks, - * it also protects other tasks from NT leaking through sysenter etc. - */ -#define switch_to(prev,next,last) do { \ - unsigned long esi,edi; \ - asm volatile("pushfl\n\t" /* Save flags */ \ - "pushl %%ebp\n\t" \ - "movl %%esp,%0\n\t" /* save ESP */ \ - "movl %5,%%esp\n\t" /* restore ESP */ \ - "movl $1f,%1\n\t" /* save EIP */ \ - "pushl %6\n\t" /* restore EIP */ \ - "jmp __switch_to\n" \ - "1:\t" \ - "popl %%ebp\n\t" \ - "popfl" \ - :"=m" (prev->thread.sp),"=m" (prev->thread.ip), \ - "=a" (last),"=S" (esi),"=D" (edi) \ - :"m" (next->thread.sp),"m" (next->thread.ip), \ - "2" (prev), "d" (next)); \ -} while (0) - -#endif /* __KERNEL__ */ - - #include <linux/irqflags.h> /* |