diff options
Diffstat (limited to 'xenolinux-2.4.21-pre4-sparse/include/asm-xeno/system.h')
-rw-r--r-- | xenolinux-2.4.21-pre4-sparse/include/asm-xeno/system.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/system.h b/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/system.h index 387ac0fdad..629c9d756b 100644 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/system.h +++ b/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/system.h @@ -10,10 +10,16 @@ #ifdef __KERNEL__ -struct task_struct; /* one of the stranger aspects of C forward declarations.. */ -extern void FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next)); - -#define prepare_to_switch() do { } while(0) +struct task_struct; +extern void FASTCALL(__switch_to(struct task_struct *prev, + struct task_struct *next)); + +#define prepare_to_switch() \ +do { \ + struct thread_struct *__t = ¤t->thread; \ + __asm__ __volatile__ ( "movl %%fs,%0" : "=m" (*(int *)&__t->fs) ); \ + __asm__ __volatile__ ( "movl %%gs,%0" : "=m" (*(int *)&__t->gs) ); \ +} while (0) #define switch_to(prev,next,last) do { \ asm volatile("pushl %%esi\n\t" \ "pushl %%edi\n\t" \ |