mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 22:21:42 +00:00
ec7fcaabbf
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>
17 lines
278 B
C
17 lines
278 B
C
#ifndef _I386_CURRENT_H
|
|
#define _I386_CURRENT_H
|
|
|
|
#include <asm/pda.h>
|
|
#include <linux/compiler.h>
|
|
|
|
struct task_struct;
|
|
|
|
static __always_inline struct task_struct *get_current(void)
|
|
{
|
|
return read_pda(pcurrent);
|
|
}
|
|
|
|
#define current get_current()
|
|
|
|
#endif /* !(_I386_CURRENT_H) */
|