4 #include <asm/segment.h>
5 #include <asm/cpufeature.h>
6 #include <asm/cmpxchg.h>
9 #define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */
11 struct task_struct; /* one of the stranger aspects of C forward declarations.. */
12 extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next));
15 * Saving eflags is important. It switches not only IOPL between tasks,
16 * it also protects other tasks from NT leaking through sysenter etc.
18 #define switch_to(prev,next,last) do { \
19 unsigned long esi,edi; \
20 asm volatile("pushfl\n\t" /* Save flags */ \
22 "movl %%esp,%0\n\t" /* save ESP */ \
23 "movl %5,%%esp\n\t" /* restore ESP */ \
24 "movl $1f,%1\n\t" /* save EIP */ \
25 "pushl %6\n\t" /* restore EIP */ \
30 :"=m" (prev->thread.sp),"=m" (prev->thread.ip), \
31 "=a" (last),"=S" (esi),"=D" (edi) \
32 :"m" (next->thread.sp),"m" (next->thread.ip), \
33 "2" (prev), "d" (next)); \
36 #endif /* __KERNEL__ */
39 #include <linux/irqflags.h>
42 * disable hlt during certain critical i/o operations
44 #define HAVE_DISABLE_HLT