diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 011db2f4c94c..46d680643f89 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1178,10 +1178,9 @@ struct task_struct { | |||
1178 | pid_t pid; | 1178 | pid_t pid; |
1179 | pid_t tgid; | 1179 | pid_t tgid; |
1180 | 1180 | ||
1181 | #ifdef CONFIG_CC_STACKPROTECTOR | ||
1182 | /* Canary value for the -fstack-protector gcc feature */ | 1181 | /* Canary value for the -fstack-protector gcc feature */ |
1183 | unsigned long stack_canary; | 1182 | unsigned long stack_canary; |
1184 | #endif | 1183 | |
1185 | /* | 1184 | /* |
1186 | * pointers to (original) parent process, youngest child, younger sibling, | 1185 | * pointers to (original) parent process, youngest child, younger sibling, |
1187 | * older sibling, respectively. (p->father can be replaced with | 1186 | * older sibling, respectively. (p->father can be replaced with |
@@ -2090,6 +2089,19 @@ static inline int object_is_on_stack(void *obj) | |||
2090 | 2089 | ||
2091 | extern void thread_info_cache_init(void); | 2090 | extern void thread_info_cache_init(void); |
2092 | 2091 | ||
2092 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
2093 | static inline unsigned long stack_not_used(struct task_struct *p) | ||
2094 | { | ||
2095 | unsigned long *n = end_of_stack(p); | ||
2096 | |||
2097 | do { /* Skip over canary */ | ||
2098 | n++; | ||
2099 | } while (!*n); | ||
2100 | |||
2101 | return (unsigned long)n - (unsigned long)end_of_stack(p); | ||
2102 | } | ||
2103 | #endif | ||
2104 | |||
2093 | /* set thread flags in other task's structures | 2105 | /* set thread flags in other task's structures |
2094 | * - see asm/thread_info.h for TIF_xxxx flags available | 2106 | * - see asm/thread_info.h for TIF_xxxx flags available |
2095 | */ | 2107 | */ |