0001
0002 #ifndef _ASM_POWERPC_CURRENT_H
0003 #define _ASM_POWERPC_CURRENT_H
0004 #ifdef __KERNEL__
0005
0006
0007
0008
0009 struct task_struct;
0010
0011 #ifdef __powerpc64__
0012 #include <linux/stddef.h>
0013 #include <asm/paca.h>
0014
0015 static inline struct task_struct *get_current(void)
0016 {
0017 struct task_struct *task;
0018
0019
0020 asm ("ld %0,%1(13)"
0021 : "=r" (task)
0022 : "i" (offsetof(struct paca_struct, __current)));
0023
0024 return task;
0025 }
0026 #define current get_current()
0027
0028 #else
0029
0030
0031
0032
0033 register struct task_struct *current asm ("r2");
0034
0035 #endif
0036
0037 #endif
0038 #endif