aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-um
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-07-15 23:38:48 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 09:05:38 -0700
commite18eecb8b35703a5eea73ee2b45324262029e62c (patch)
tree8c276ae6633b8116ca366274091b00491fd50bbe /include/asm-um
parentuml: use get_free_pages to allocate kernel stacks (diff)
downloadlinux-dev-e18eecb8b35703a5eea73ee2b45324262029e62c.tar.xz
linux-dev-e18eecb8b35703a5eea73ee2b45324262029e62c.zip
Add generic exit-time stack-depth checking to CONFIG_DEBUG_STACK_USAGE
Add generic exit-time stack-depth checking to CONFIG_DEBUG_STACK_USAGE. This also adds UML support. Tested on UML and i386. [akpm@linux-foundation.org: cleanups, speedups, tweaks] Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Oleg Nesterov <oleg@tv-sign.ru> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-um')
-rw-r--r--include/asm-um/thread_info.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h
index 07aa4e50e4d0..6e5fd5c892d0 100644
--- a/include/asm-um/thread_info.h
+++ b/include/asm-um/thread_info.h
@@ -52,10 +52,19 @@ static inline struct thread_info *current_thread_info(void)
return ti;
}
+#ifdef CONFIG_DEBUG_STACK_USAGE
+
+#define alloc_thread_info(tsk) \
+ ((struct thread_info *) __get_free_pages(GFP_KERNEL | __GFP_ZERO, \
+ CONFIG_KERNEL_STACK_ORDER))
+#else
+
/* thread information allocation */
#define alloc_thread_info(tsk) \
((struct thread_info *) __get_free_pages(GFP_KERNEL, \
CONFIG_KERNEL_STACK_ORDER))
+#endif
+
#define free_thread_info(ti) \
free_pages((unsigned long)(ti),CONFIG_KERNEL_STACK_ORDER)