mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[PATCH] m68k: introduce task_thread_info
new helper - task_thread_info(task). On platforms that have thread_info allocated separately (i.e. in default case) it simply returns task->thread_info. m68k wants (and for good reasons) to embed its thread_info into task_struct. So it will (in later patch) have task_thread_info() of its own. For now we just add a macro for generic case and convert existing instances of its body in core kernel to uses of new macro. Obviously safe - all normal architectures get the same preprocessor output they used to get. Signed-off-by: Al Viro <[email protected]> Signed-off-by: Roman Zippel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
7feacd5334
commit
a1261f5461
4 changed files with 15 additions and 13 deletions
|
|
@ -1233,32 +1233,34 @@ static inline void task_unlock(struct task_struct *p)
|
|||
spin_unlock(&p->alloc_lock);
|
||||
}
|
||||
|
||||
#define task_thread_info(task) (task)->thread_info
|
||||
|
||||
/* set thread flags in other task's structures
|
||||
* - see asm/thread_info.h for TIF_xxxx flags available
|
||||
*/
|
||||
static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag)
|
||||
{
|
||||
set_ti_thread_flag(tsk->thread_info,flag);
|
||||
set_ti_thread_flag(task_thread_info(tsk), flag);
|
||||
}
|
||||
|
||||
static inline void clear_tsk_thread_flag(struct task_struct *tsk, int flag)
|
||||
{
|
||||
clear_ti_thread_flag(tsk->thread_info,flag);
|
||||
clear_ti_thread_flag(task_thread_info(tsk), flag);
|
||||
}
|
||||
|
||||
static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag)
|
||||
{
|
||||
return test_and_set_ti_thread_flag(tsk->thread_info,flag);
|
||||
return test_and_set_ti_thread_flag(task_thread_info(tsk), flag);
|
||||
}
|
||||
|
||||
static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag)
|
||||
{
|
||||
return test_and_clear_ti_thread_flag(tsk->thread_info,flag);
|
||||
return test_and_clear_ti_thread_flag(task_thread_info(tsk), flag);
|
||||
}
|
||||
|
||||
static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag)
|
||||
{
|
||||
return test_ti_thread_flag(tsk->thread_info,flag);
|
||||
return test_ti_thread_flag(task_thread_info(tsk), flag);
|
||||
}
|
||||
|
||||
static inline void set_tsk_need_resched(struct task_struct *tsk)
|
||||
|
|
@ -1329,12 +1331,12 @@ extern void signal_wake_up(struct task_struct *t, int resume_stopped);
|
|||
|
||||
static inline unsigned int task_cpu(const struct task_struct *p)
|
||||
{
|
||||
return p->thread_info->cpu;
|
||||
return task_thread_info(p)->cpu;
|
||||
}
|
||||
|
||||
static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
|
||||
{
|
||||
p->thread_info->cpu = cpu;
|
||||
task_thread_info(p)->cpu = cpu;
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
|
|||
Loading…
Reference in a new issue