diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2007-05-02 13:27:16 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-05-02 13:27:16 -0400 |
commit | 7c3576d261ce046789a7db14f43303f8120910c7 (patch) | |
tree | ad27a8459bbcdb183fe2411aec3b840942992ad5 /include/asm-i386/current.h | |
parent | 7a61d35d4b4056e7711031202da7605e052f4137 (diff) |
[PATCH] i386: Convert PDA into the percpu section
Currently x86 (similar to x84-64) has a special per-cpu structure
called "i386_pda" which can be easily and efficiently referenced via
the %fs register. An ELF section is more flexible than a structure,
allowing any piece of code to use this area. Indeed, such a section
already exists: the per-cpu area.
So this patch:
(1) Removes the PDA and uses per-cpu variables for each current member.
(2) Replaces the __KERNEL_PDA segment with __KERNEL_PERCPU.
(3) Creates a per-cpu mirror of __per_cpu_offset called this_cpu_off, which
can be used to calculate addresses for this CPU's variables.
(4) Simplifies startup, because %fs doesn't need to be loaded with a
special segment at early boot; it can be deferred until the first
percpu area is allocated (or never for UP).
The result is less code and one less x86-specific concept.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andi Kleen <ak@suse.de>
Diffstat (limited to 'include/asm-i386/current.h')
-rw-r--r-- | include/asm-i386/current.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/asm-i386/current.h b/include/asm-i386/current.h index 5252ee0f6d7a..d35248539912 100644 --- a/include/asm-i386/current.h +++ b/include/asm-i386/current.h | |||
@@ -1,14 +1,15 @@ | |||
1 | #ifndef _I386_CURRENT_H | 1 | #ifndef _I386_CURRENT_H |
2 | #define _I386_CURRENT_H | 2 | #define _I386_CURRENT_H |
3 | 3 | ||
4 | #include <asm/pda.h> | ||
5 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | #include <asm/percpu.h> | ||
6 | 6 | ||
7 | struct task_struct; | 7 | struct task_struct; |
8 | 8 | ||
9 | DECLARE_PER_CPU(struct task_struct *, current_task); | ||
9 | static __always_inline struct task_struct *get_current(void) | 10 | static __always_inline struct task_struct *get_current(void) |
10 | { | 11 | { |
11 | return read_pda(pcurrent); | 12 | return x86_read_percpu(current_task); |
12 | } | 13 | } |
13 | 14 | ||
14 | #define current get_current() | 15 | #define current get_current() |