aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/cpu/common.c
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2006-12-07 02:14:03 +0100
committerAndi Kleen <andi@basil.nowhere.org>2006-12-07 02:14:03 +0100
commitec7fcaabbfb3c5bd5189f857b6ac7bb9745ef291 (patch)
tree9730e2849a9943e26f8d32f394296fd685b85e39 /arch/i386/kernel/cpu/common.c
parent[PATCH] i386: Implement smp_processor_id() with the PDA (diff)
downloadlinux-dev-ec7fcaabbfb3c5bd5189f857b6ac7bb9745ef291.tar.xz
linux-dev-ec7fcaabbfb3c5bd5189f857b6ac7bb9745ef291.zip
[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>
Diffstat (limited to 'arch/i386/kernel/cpu/common.c')
-rw-r--r--arch/i386/kernel/cpu/common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index e476202b887f..6958ae5e2fa5 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -651,6 +651,7 @@ __cpuinit int alloc_gdt(int cpu)
struct i386_pda boot_pda = {
._pda = &boot_pda,
.cpu_number = 0,
+ .pcurrent = &init_task,
};
static inline void set_kernel_gs(void)
@@ -696,6 +697,7 @@ __cpuinit int init_gdt(int cpu, struct task_struct *idle)
memset(pda, 0, sizeof(*pda));
pda->_pda = pda;
pda->cpu_number = cpu;
+ pda->pcurrent = idle;
return 1;
}