X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Fasm-powerpc%2Fcurrent.h;h=e2c7f06931e72dfb514b19ef1ff1028306e88891;hb=24a5ae5d0340d5a45df840b24a10d62aa9516116;hp=82cd4a9ca99a92faca63cf01e41ebc75f6a35c38;hpb=3b621ee5df437d3f332a635ab6421aaa61a7dc2b;p=linux-2.6-omap-h63xx.git diff --git a/include/asm-powerpc/current.h b/include/asm-powerpc/current.h index 82cd4a9ca99..e2c7f06931e 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 */