summaryrefslogtreecommitdiff
path: root/include/asm-sh/thread_info.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-09-27 18:20:16 +0900
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 18:20:16 +0900
commitd153ea88dccf003173315b5d21acabebb897fb4a (patch)
tree5cdc96ef0ec58026d82c03f76250ac1833f566d4 /include/asm-sh/thread_info.h
parent7a440c950efb5cdc8a05cc6c3ec8fc864b60ef77 (diff)
sh: stack debugging support.
This adds a DEBUG_STACK_USAGE and DEBUG_STACKOVERFLOW for SH. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh/thread_info.h')
-rw-r--r--include/asm-sh/thread_info.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/asm-sh/thread_info.h b/include/asm-sh/thread_info.h
index 5eb874b065a6..605259f88113 100644
--- a/include/asm-sh/thread_info.h
+++ b/include/asm-sh/thread_info.h
@@ -29,6 +29,8 @@ struct thread_info {
#endif
#define PREEMPT_ACTIVE 0x10000000
+#define THREAD_SIZE (PAGE_SIZE * 2)
+#define STACK_WARN (THREAD_SIZE / 8)
/*
* macros/functions for gaining access to the thread information structure
@@ -50,8 +52,6 @@ struct thread_info {
#define init_thread_info (init_thread_union.thread_info)
#define init_stack (init_thread_union.stack)
-#define THREAD_SIZE (2*PAGE_SIZE)
-
/* how to get the thread information struct from C */
static inline struct thread_info *current_thread_info(void)
{
@@ -73,8 +73,12 @@ static inline struct thread_info *current_thread_info(void)
}
/* thread information allocation */
-#define alloc_thread_info(ti) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1))
-#define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
+#ifdef CONFIG_DEBUG_STACK_USAGE
+#define alloc_thread_info(ti) kzalloc(THREAD_SIZE, GFP_KERNEL)
+#else
+#define alloc_thread_info(ti) kmalloc(THREAD_SIZE, GFP_KERNEL)
+#endif
+#define free_thread_info(ti) kfree(ti)
#else /* !__ASSEMBLY__ */