Messages in this thread Patch in this message |  | | | Date | Mon, 25 Sep 2006 11:45:46 -0700 | | From | jeremy@goop ... | | Subject | [PATCH 6/6] 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> 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>
--- include/asm-i386/current.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff -r 3752f3a5974a include/asm-i386/current.h --- a/include/asm-i386/current.h Mon Sep 25 01:48:09 2006 -0700 +++ b/include/asm-i386/current.h Mon Sep 25 01:48:09 2006 -0700 @@ -1,13 +1,14 @@ #ifndef _I386_CURRENT_H #define _I386_CURRENT_H -#include <linux/thread_info.h> +#include <asm/pda.h> +#include <linux/compiler.h> struct task_struct; -static __always_inline struct task_struct * get_current(void) +static __always_inline struct task_struct *get_current(void) { - return current_thread_info()->task; + return read_pda(pcurrent); } #define current get_current() --
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |