X-Git-Url: https://nv-tegra.nvidia.com/r/gitweb?p=linux-2.6.git;a=blobdiff_plain;f=include%2Flinux%2Fsched.h;h=a7c7698583bb15bae4de5b0da9b8aeda61019c5f;hp=8c216e057c94230ea01c110b0f5bc2c28e8f9ee3;hb=6d2e91bf80e4410207f01edb0962aec9213f3533;hpb=dd39ecf522ba86c70809715af46e6557f6491131 diff --git a/include/linux/sched.h b/include/linux/sched.h index 8c216e057c9..a7c7698583b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1178,10 +1178,9 @@ struct task_struct { pid_t pid; pid_t tgid; -#ifdef CONFIG_CC_STACKPROTECTOR /* Canary value for the -fstack-protector gcc feature */ unsigned long stack_canary; -#endif + /* * pointers to (original) parent process, youngest child, younger sibling, * older sibling, respectively. (p->father can be replaced with @@ -2087,6 +2086,19 @@ static inline int object_is_on_stack(void *obj) extern void thread_info_cache_init(void); +#ifdef CONFIG_DEBUG_STACK_USAGE +static inline unsigned long stack_not_used(struct task_struct *p) +{ + unsigned long *n = end_of_stack(p); + + do { /* Skip over canary */ + n++; + } while (!*n); + + return (unsigned long)n - (unsigned long)end_of_stack(p); +} +#endif + /* set thread flags in other task's structures * - see asm/thread_info.h for TIF_xxxx flags available */