mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-25 21:54:06 +08: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) */
|