aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index f134a0f7080a..b85b10abf770 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1159,10 +1159,9 @@ struct task_struct {
1159 pid_t pid; 1159 pid_t pid;
1160 pid_t tgid; 1160 pid_t tgid;
1161 1161
1162#ifdef CONFIG_CC_STACKPROTECTOR
1163 /* Canary value for the -fstack-protector gcc feature */ 1162 /* Canary value for the -fstack-protector gcc feature */
1164 unsigned long stack_canary; 1163 unsigned long stack_canary;
1165#endif 1164
1166 /* 1165 /*
1167 * pointers to (original) parent process, youngest child, younger sibling, 1166 * pointers to (original) parent process, youngest child, younger sibling,
1168 * older sibling, respectively. (p->father can be replaced with 1167 * older sibling, respectively. (p->father can be replaced with
@@ -2069,6 +2068,19 @@ static inline int object_is_on_stack(void *obj)
2069 2068
2070extern void thread_info_cache_init(void); 2069extern void thread_info_cache_init(void);
2071 2070
2071#ifdef CONFIG_DEBUG_STACK_USAGE
2072static inline unsigned long stack_not_used(struct task_struct *p)
2073{
2074 unsigned long *n = end_of_stack(p);
2075
2076 do { /* Skip over canary */
2077 n++;
2078 } while (!*n);
2079
2080 return (unsigned long)n - (unsigned long)end_of_stack(p);
2081}
2082#endif
2083
2072/* set thread flags in other task's structures 2084/* set thread flags in other task's structures
2073 * - see asm/thread_info.h for TIF_xxxx flags available 2085 * - see asm/thread_info.h for TIF_xxxx flags available
2074 */ 2086 */