diff options
author | Al Viro <viro@parcelfarce.linux.theplanet.co.uk> | 2005-11-13 19:06:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-13 21:14:13 -0500 |
commit | a1261f54611ec4ad6a7ab7080f86747e3ac3685b (patch) | |
tree | 8a65c419da590e3712543f69284fb5f8cd613a37 /include/linux/sched.h | |
parent | 7feacd53347c04aee789ba5d632eda0c3fc421c4 (diff) |
[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 <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 2bbf968b23d9..f8650314ba2f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1233,32 +1233,34 @@ static inline void task_unlock(struct task_struct *p) | |||
1233 | spin_unlock(&p->alloc_lock); | 1233 | spin_unlock(&p->alloc_lock); |
1234 | } | 1234 | } |
1235 | 1235 | ||
1236 | #define task_thread_info(task) (task)->thread_info | ||
1237 | |||
1236 | /* set thread flags in other task's structures | 1238 | /* set thread flags in other task's structures |
1237 | * - see asm/thread_info.h for TIF_xxxx flags available | 1239 | * - see asm/thread_info.h for TIF_xxxx flags available |
1238 | */ | 1240 | */ |
1239 | static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag) | 1241 | static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag) |
1240 | { | 1242 | { |
1241 | set_ti_thread_flag(tsk->thread_info,flag); | 1243 | set_ti_thread_flag(task_thread_info(tsk), flag); |
1242 | } | 1244 | } |
1243 | 1245 | ||
1244 | static inline void clear_tsk_thread_flag(struct task_struct *tsk, int flag) | 1246 | static inline void clear_tsk_thread_flag(struct task_struct *tsk, int flag) |
1245 | { | 1247 | { |
1246 | clear_ti_thread_flag(tsk->thread_info,flag); | 1248 | clear_ti_thread_flag(task_thread_info(tsk), flag); |
1247 | } | 1249 | } |
1248 | 1250 | ||
1249 | static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag) | 1251 | static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag) |
1250 | { | 1252 | { |
1251 | return test_and_set_ti_thread_flag(tsk->thread_info,flag); | 1253 | return test_and_set_ti_thread_flag(task_thread_info(tsk), flag); |
1252 | } | 1254 | } |
1253 | 1255 | ||
1254 | static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag) | 1256 | static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag) |
1255 | { | 1257 | { |
1256 | return test_and_clear_ti_thread_flag(tsk->thread_info,flag); | 1258 | return test_and_clear_ti_thread_flag(task_thread_info(tsk), flag); |
1257 | } | 1259 | } |
1258 | 1260 | ||
1259 | static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag) | 1261 | static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag) |
1260 | { | 1262 | { |
1261 | return test_ti_thread_flag(tsk->thread_info,flag); | 1263 | return test_ti_thread_flag(task_thread_info(tsk), flag); |
1262 | } | 1264 | } |
1263 | 1265 | ||
1264 | static inline void set_tsk_need_resched(struct task_struct *tsk) | 1266 | 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); | |||
1329 | 1331 | ||
1330 | static inline unsigned int task_cpu(const struct task_struct *p) | 1332 | static inline unsigned int task_cpu(const struct task_struct *p) |
1331 | { | 1333 | { |
1332 | return p->thread_info->cpu; | 1334 | return task_thread_info(p)->cpu; |
1333 | } | 1335 | } |
1334 | 1336 | ||
1335 | static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) | 1337 | static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) |
1336 | { | 1338 | { |
1337 | p->thread_info->cpu = cpu; | 1339 | task_thread_info(p)->cpu = cpu; |
1338 | } | 1340 | } |
1339 | 1341 | ||
1340 | #else | 1342 | #else |