Path: blob/master/arch/powerpc/include/asm/current.h
15117 views
#ifndef _ASM_POWERPC_CURRENT_H1#define _ASM_POWERPC_CURRENT_H2#ifdef __KERNEL__34/*5* This program is free software; you can redistribute it and/or6* modify it under the terms of the GNU General Public License7* as published by the Free Software Foundation; either version8* 2 of the License, or (at your option) any later version.9*/1011struct task_struct;1213#ifdef __powerpc64__14#include <linux/stddef.h>15#include <asm/paca.h>1617static inline struct task_struct *get_current(void)18{19struct task_struct *task;2021__asm__ __volatile__("ld %0,%1(13)"22: "=r" (task)23: "i" (offsetof(struct paca_struct, __current)));2425return task;26}27#define current get_current()2829#else3031/*32* We keep `current' in r2 for speed.33*/34register struct task_struct *current asm ("r2");3536#endif3738#endif /* __KERNEL__ */39#endif /* _ASM_POWERPC_CURRENT_H */404142