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 5a7c76388731..2225c207801c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1160,10 +1160,9 @@ struct task_struct { | |||
1160 | pid_t pid; | 1160 | pid_t pid; |
1161 | pid_t tgid; | 1161 | pid_t tgid; |
1162 | 1162 | ||
1163 | #ifdef CONFIG_CC_STACKPROTECTOR | ||
1164 | /* Canary value for the -fstack-protector gcc feature */ | 1163 | /* Canary value for the -fstack-protector gcc feature */ |
1165 | unsigned long stack_canary; | 1164 | unsigned long stack_canary; |
1166 | #endif | 1165 | |
1167 | /* | 1166 | /* |
1168 | * pointers to (original) parent process, youngest child, younger sibling, | 1167 | * pointers to (original) parent process, youngest child, younger sibling, |
1169 | * older sibling, respectively. (p->father can be replaced with | 1168 | * older sibling, respectively. (p->father can be replaced with |
@@ -2069,6 +2068,19 @@ static inline int object_is_on_stack(void *obj) | |||
2069 | 2068 | ||
2070 | extern void thread_info_cache_init(void); | 2069 | extern void thread_info_cache_init(void); |
2071 | 2070 | ||
2071 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
2072 | static 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 | */ |