1 #ifndef _X86_64_CURRENT_H
2 #define _X86_64_CURRENT_H
4 #if !defined(__ASSEMBLY__)
9 static inline struct task_struct *get_current(void)
11 struct task_struct *t = read_pda(pcurrent);
16 static inline struct task_struct *stack_current(void)
18 struct task_struct *current;
19 __asm__("andq %%rsp,%0; ":"=r" (current)
20 : "0" (~(unsigned long)(THREAD_SIZE-1)));
25 #define current get_current()
30 #include <asm/offset.h>
33 #define GET_CURRENT(reg) movq %gs:(pda_pcurrent),reg
37 #endif /* !(_X86_64_CURRENT_H) */