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 02e16d207304..681394f3a0cf 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1161,10 +1161,9 @@ struct task_struct { | |||
| 1161 | pid_t pid; | 1161 | pid_t pid; |
| 1162 | pid_t tgid; | 1162 | pid_t tgid; |
| 1163 | 1163 | ||
| 1164 | #ifdef CONFIG_CC_STACKPROTECTOR | ||
| 1165 | /* Canary value for the -fstack-protector gcc feature */ | 1164 | /* Canary value for the -fstack-protector gcc feature */ |
| 1166 | unsigned long stack_canary; | 1165 | unsigned long stack_canary; |
| 1167 | #endif | 1166 | |
| 1168 | /* | 1167 | /* |
| 1169 | * pointers to (original) parent process, youngest child, younger sibling, | 1168 | * pointers to (original) parent process, youngest child, younger sibling, |
| 1170 | * older sibling, respectively. (p->father can be replaced with | 1169 | * older sibling, respectively. (p->father can be replaced with |
| @@ -2070,6 +2069,19 @@ static inline int object_is_on_stack(void *obj) | |||
| 2070 | 2069 | ||
| 2071 | extern void thread_info_cache_init(void); | 2070 | extern void thread_info_cache_init(void); |
| 2072 | 2071 | ||
| 2072 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
| 2073 | static inline unsigned long stack_not_used(struct task_struct *p) | ||
| 2074 | { | ||
| 2075 | unsigned long *n = end_of_stack(p); | ||
| 2076 | |||
| 2077 | do { /* Skip over canary */ | ||
| 2078 | n++; | ||
| 2079 | } while (!*n); | ||
| 2080 | |||
| 2081 | return (unsigned long)n - (unsigned long)end_of_stack(p); | ||
| 2082 | } | ||
| 2083 | #endif | ||
| 2084 | |||
| 2073 | /* set thread flags in other task's structures | 2085 | /* set thread flags in other task's structures |
| 2074 | * - see asm/thread_info.h for TIF_xxxx flags available | 2086 | * - see asm/thread_info.h for TIF_xxxx flags available |
| 2075 | */ | 2087 | */ |
