[PATCH] i386: Implement "current" with the PDA
Use the pcurrent field in the PDA to implement the "current" macro. This ends
up compiling down to a single instruction to get the current task.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Chuck Ebbert <76306.1226@compuserve.com>
Cc: Zachary Amsden <zach@vmware.com>
Cc: Jan Beulich <jbeulich@novell.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index dc42725..8749b10 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -684,6 +684,7 @@
if (unlikely(prev->fs | next->fs))
loadsegment(fs, next->fs);
+ write_pda(pcurrent, next_p);
/*
* Restore IOPL if needed.