diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2006-12-06 20:14:03 -0500 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-12-06 20:14:03 -0500 |
commit | ec7fcaabbfb3c5bd5189f857b6ac7bb9745ef291 (patch) | |
tree | 9730e2849a9943e26f8d32f394296fd685b85e39 /include/asm-i386/current.h | |
parent | b2938f880890ebfcccad356275e0000193153623 (diff) |
[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 'include/asm-i386/current.h')
-rw-r--r-- | include/asm-i386/current.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/asm-i386/current.h b/include/asm-i386/current.h index 3cbbecd79016..5252ee0f6d7a 100644 --- a/include/asm-i386/current.h +++ b/include/asm-i386/current.h | |||
@@ -1,13 +1,14 @@ | |||
1 | #ifndef _I386_CURRENT_H | 1 | #ifndef _I386_CURRENT_H |
2 | #define _I386_CURRENT_H | 2 | #define _I386_CURRENT_H |
3 | 3 | ||
4 | #include <linux/thread_info.h> | 4 | #include <asm/pda.h> |
5 | #include <linux/compiler.h> | ||
5 | 6 | ||
6 | struct task_struct; | 7 | struct task_struct; |
7 | 8 | ||
8 | static __always_inline struct task_struct * get_current(void) | 9 | static __always_inline struct task_struct *get_current(void) |
9 | { | 10 | { |
10 | return current_thread_info()->task; | 11 | return read_pda(pcurrent); |
11 | } | 12 | } |
12 | 13 | ||
13 | #define current get_current() | 14 | #define current get_current() |