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 0237d124089f..5b9424eaa58f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h  | |||
| @@ -1182,10 +1182,9 @@ struct task_struct { | |||
| 1182 | pid_t pid; | 1182 | pid_t pid; | 
| 1183 | pid_t tgid; | 1183 | pid_t tgid; | 
| 1184 | 1184 | ||
| 1185 | #ifdef CONFIG_CC_STACKPROTECTOR | ||
| 1186 | /* Canary value for the -fstack-protector gcc feature */ | 1185 | /* Canary value for the -fstack-protector gcc feature */ | 
| 1187 | unsigned long stack_canary; | 1186 | unsigned long stack_canary; | 
| 1188 | #endif | 1187 | |
| 1189 | /* | 1188 | /* | 
| 1190 | * pointers to (original) parent process, youngest child, younger sibling, | 1189 | * pointers to (original) parent process, youngest child, younger sibling, | 
| 1191 | * older sibling, respectively. (p->father can be replaced with | 1190 | * older sibling, respectively. (p->father can be replaced with | 
| @@ -2102,6 +2101,19 @@ static inline int object_is_on_stack(void *obj) | |||
| 2102 | 2101 | ||
| 2103 | extern void thread_info_cache_init(void); | 2102 | extern void thread_info_cache_init(void); | 
| 2104 | 2103 | ||
| 2104 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
| 2105 | static inline unsigned long stack_not_used(struct task_struct *p) | ||
| 2106 | { | ||
| 2107 | unsigned long *n = end_of_stack(p); | ||
| 2108 | |||
| 2109 | do { /* Skip over canary */ | ||
| 2110 | n++; | ||
| 2111 | } while (!*n); | ||
| 2112 | |||
| 2113 | return (unsigned long)n - (unsigned long)end_of_stack(p); | ||
| 2114 | } | ||
| 2115 | #endif | ||
| 2116 | |||
| 2105 | /* set thread flags in other task's structures | 2117 | /* set thread flags in other task's structures | 
| 2106 | * - see asm/thread_info.h for TIF_xxxx flags available | 2118 | * - see asm/thread_info.h for TIF_xxxx flags available | 
| 2107 | */ | 2119 | */ | 
