diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-02-05 08:31:22 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-03-02 19:45:24 -0500 |
commit | 9049863a32fad5d7158318e45f0a41a0f2192c0c (patch) | |
tree | 18acb5b1a7d253fc99b6a80196d95a6e0f7ce3cc /include/linux/sched/task_stack.h | |
parent | 28851755990c832d7050d5e1e2c91ed9d9e6fe59 (diff) |
sched/headers: Move kstack_end() from <linux/sched.h> to <linux/sched/task_stack.h>
This is a task-stack related API, not core scheduler functionality.
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/sched/task_stack.h')
-rw-r--r-- | include/linux/sched/task_stack.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/sched/task_stack.h b/include/linux/sched/task_stack.h index aaa5c2a6a0e9..df6ea6665b31 100644 --- a/include/linux/sched/task_stack.h +++ b/include/linux/sched/task_stack.h | |||
@@ -108,4 +108,14 @@ static inline unsigned long stack_not_used(struct task_struct *p) | |||
108 | #endif | 108 | #endif |
109 | extern void set_task_stack_end_magic(struct task_struct *tsk); | 109 | extern void set_task_stack_end_magic(struct task_struct *tsk); |
110 | 110 | ||
111 | #ifndef __HAVE_ARCH_KSTACK_END | ||
112 | static inline int kstack_end(void *addr) | ||
113 | { | ||
114 | /* Reliable end of stack detection: | ||
115 | * Some APM bios versions misalign the stack | ||
116 | */ | ||
117 | return !(((unsigned long)addr+sizeof(void*)-1) & (THREAD_SIZE-sizeof(void*))); | ||
118 | } | ||
119 | #endif | ||
120 | |||
111 | #endif /* _LINUX_SCHED_TASK_STACK_H */ | 121 | #endif /* _LINUX_SCHED_TASK_STACK_H */ |