aboutsummaryrefslogtreecommitdiffstats
path: root/xenolinux-2.4.21-pre4-sparse
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2003-04-16 22:39:42 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2003-04-16 22:39:42 +0000
commit38c74189625b4ab59f49ce795c887a46b8fdbd3d (patch)
tree280ce2a7f56d736d30d0e533b709481baf59b93a /xenolinux-2.4.21-pre4-sparse
parentddbb5431fdecfef31a70c810b52b6145ce05a6d5 (diff)
downloadxen-38c74189625b4ab59f49ce795c887a46b8fdbd3d.tar.gz
xen-38c74189625b4ab59f49ce795c887a46b8fdbd3d.tar.bz2
xen-38c74189625b4ab59f49ce795c887a46b8fdbd3d.zip
bitkeeper revision 1.177 (3e9ddbaeZvT8WLJjkXqctK8YH2xb1A)
system.h, process.c: Fixed Xenolinux context switch code so that FS and GS are properly saved for the old process.
Diffstat (limited to 'xenolinux-2.4.21-pre4-sparse')
-rw-r--r--xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c7
-rw-r--r--xenolinux-2.4.21-pre4-sparse/include/asm-xeno/system.h14
2 files changed, 10 insertions, 11 deletions
diff --git a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c b/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c
index 4dc1273c7b..d4db667474 100644
--- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c
+++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c
@@ -370,13 +370,6 @@ void __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
__sti();
/*
- * Save away %fs and %gs. No need to save %es and %ds, as
- * those are always kernel segments while inside the kernel.
- */
- asm volatile("movl %%fs,%0":"=m" (*(int *)&prev->fs));
- asm volatile("movl %%gs,%0":"=m" (*(int *)&prev->gs));
-
- /*
* Restore %fs and %gs.
*/
loadsegment(fs, next->fs);
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 = &current->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" \