diff options
author | Al Viro <viro@parcelfarce.linux.theplanet.co.uk> | 2005-11-13 16:06:56 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-13 18:14:13 -0800 |
commit | 10ebffde3d3916026974352b7900e44afe2b243f (patch) | |
tree | ac88fa33694f5bea1b6958e1e56bcd4c9b95b002 /include | |
parent | a1261f54611ec4ad6a7ab7080f86747e3ac3685b (diff) | |
download | blackbird-op-linux-10ebffde3d3916026974352b7900e44afe2b243f.tar.gz blackbird-op-linux-10ebffde3d3916026974352b7900e44afe2b243f.zip |
[PATCH] m68k: introduce setup_thread_stack() and end_of_stack()
encapsulates the rest of arch-dependent operations with thread_info access.
Two new helpers - setup_thread_stack() and end_of_stack(). For normal case
the former consists of copying thread_info of parent to new thread_info and
the latter returns pointer immediately past the end of thread_info.
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')
-rw-r--r-- | include/linux/sched.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index f8650314ba2f..e4681256e43e 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1235,6 +1235,17 @@ static inline void task_unlock(struct task_struct *p) #define task_thread_info(task) (task)->thread_info +static inline void setup_thread_stack(struct task_struct *p, struct task_struct *org) +{ + *task_thread_info(p) = *task_thread_info(org); + task_thread_info(p)->task = p; +} + +static inline unsigned long *end_of_stack(struct task_struct *p) +{ + return (unsigned long *)(p->thread_info + 1); +} + /* set thread flags in other task's structures * - see asm/thread_info.h for TIF_xxxx flags available */ |