X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=include%2Fasm-powerpc%2Fcurrent.h;h=e2c7f06931e72dfb514b19ef1ff1028306e88891;hb=1a1b285c24e1468afe82b09330dde5192a6e0013;hp=82cd4a9ca99a92faca63cf01e41ebc75f6a35c38;hpb=0192d69789582f02c015cba77cac514c7291c347;p=powerpc.git diff --git a/include/asm-powerpc/current.h b/include/asm-powerpc/current.h index 82cd4a9ca9..e2c7f06931 100644 --- a/include/asm-powerpc/current.h +++ b/include/asm-powerpc/current.h @@ -1,5 +1,6 @@ #ifndef _ASM_POWERPC_CURRENT_H #define _ASM_POWERPC_CURRENT_H +#ifdef __KERNEL__ /* * This program is free software; you can redistribute it and/or @@ -11,9 +12,20 @@ struct task_struct; #ifdef __powerpc64__ +#include #include -#define current (get_paca()->__current) +static inline struct task_struct *get_current(void) +{ + struct task_struct *task; + + __asm__ __volatile__("ld %0,%1(13)" + : "=r" (task) + : "i" (offsetof(struct paca_struct, __current))); + + return task; +} +#define current get_current() #else @@ -24,4 +36,5 @@ register struct task_struct *current asm ("r2"); #endif +#endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_CURRENT_H */