aboutsummaryrefslogtreecommitdiff
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-03-23 14:50:03 +0100
committerThomas Gleixner <tglx@linutronix.de>2009-03-23 21:20:20 +0100
commit80c5520811d3805adcb15c570ea5e2d489fa5d0b (patch)
treeae797a7f4af39f80e77526533d06ac23b439f0ab /include/linux/sched.h
parentb3e3b302cf6dc8d60b67f0e84d1fa5648889c038 (diff)
parent8c083f081d0014057901c68a0a3e0f8ca7ac8d23 (diff)
Merge branch 'cpus4096' into irq/threaded
Conflicts: arch/parisc/kernel/irq.c kernel/irq/handle.c Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 011db2f4c94..46d680643f8 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
@@ -2090,6 +2089,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
*/