1367b8112SChris Zankel /* 2367b8112SChris Zankel * include/asm-xtensa/current.h 3367b8112SChris Zankel * 4367b8112SChris Zankel * This file is subject to the terms and conditions of the GNU General Public 5367b8112SChris Zankel * License. See the file "COPYING" in the main directory of this archive 6367b8112SChris Zankel * for more details. 7367b8112SChris Zankel * 8367b8112SChris Zankel * Copyright (C) 2001 - 2005 Tensilica Inc. 9367b8112SChris Zankel */ 10367b8112SChris Zankel 11367b8112SChris Zankel #ifndef _XTENSA_CURRENT_H 12367b8112SChris Zankel #define _XTENSA_CURRENT_H 13367b8112SChris Zankel 14f4431396SMax Filippov #include <asm/thread_info.h> 15f4431396SMax Filippov 16367b8112SChris Zankel #ifndef __ASSEMBLY__ 17367b8112SChris Zankel 18367b8112SChris Zankel #include <linux/thread_info.h> 19367b8112SChris Zankel 20367b8112SChris Zankel struct task_struct; 21367b8112SChris Zankel get_current(void)22367b8112SChris Zankelstatic inline struct task_struct *get_current(void) 23367b8112SChris Zankel { 24367b8112SChris Zankel return current_thread_info()->task; 25367b8112SChris Zankel } 26367b8112SChris Zankel 27367b8112SChris Zankel #define current get_current() 28367b8112SChris Zankel 29*92652cf9SKees Cook register unsigned long current_stack_pointer __asm__("a1"); 30*92652cf9SKees Cook 31367b8112SChris Zankel #else 32367b8112SChris Zankel 33367b8112SChris Zankel #define GET_CURRENT(reg,sp) \ 34367b8112SChris Zankel GET_THREAD_INFO(reg,sp); \ 35367b8112SChris Zankel l32i reg, reg, TI_TASK \ 36367b8112SChris Zankel 37367b8112SChris Zankel #endif 38367b8112SChris Zankel 39367b8112SChris Zankel 40367b8112SChris Zankel #endif /* XTENSA_CURRENT_H */ 41