| Update of /cvsroot/linuxsh/linux/include/asm-sh
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16840/include/asm-sh
Modified Files:
	page.h thread_info.h 
Log Message:
Stack debugging support, based on ST's old patch.
Index: page.h
===================================================================
RCS file: /cvsroot/linuxsh/linux/include/asm-sh/page.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- page.h	19 Jul 2006 15:45:38 -0000	1.17
+++ page.h	8 Aug 2006 03:07:13 -0000	1.18
@@ -17,7 +17,7 @@
 
 /* PAGE_SHIFT determines the page size */
 #define PAGE_SHIFT	12
-#define PAGE_SIZE	(1UL << PAGE_SHIFT)
+#define PAGE_SIZE	(1 << PAGE_SHIFT)
 #define PAGE_MASK	(~(PAGE_SIZE-1))
 #define PTE_MASK	PAGE_MASK
 
Index: thread_info.h
===================================================================
RCS file: /cvsroot/linuxsh/linux/include/asm-sh/thread_info.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- thread_info.h	31 Jul 2006 01:21:09 -0000	1.19
+++ thread_info.h	8 Aug 2006 03:07:13 -0000	1.20
@@ -29,6 +29,8 @@
 #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 @@
 #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 @@
 }
 
 /* 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__ */
 
 |