]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-um/thread_info.h
Add sg helpers for iterating over a scatterlist table
[linux-2.6-omap-h63xx.git] / include / asm-um / thread_info.h
index f166b9837c6a59eca771e760d2b4b46dbfbd3a43..6e5fd5c892d069439ed56191d837df54dd94dd58 100644 (file)
@@ -8,7 +8,6 @@
 
 #ifndef __ASSEMBLY__
 
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/types.h>
 
@@ -23,6 +22,7 @@ struct thread_info {
                                                   0-0xBFFFFFFF for user
                                                   0-0xFFFFFFFF for kernel */
        struct restart_block    restart_block;
+       struct thread_info      *real_thread;    /* Points to non-IRQ stack */
 };
 
 #define INIT_THREAD_INFO(tsk)                  \
@@ -36,6 +36,7 @@ struct thread_info {
        .restart_block =  {                     \
                .fn =  do_no_restart_syscall,   \
        },                                      \
+       .real_thread = NULL,                    \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
@@ -51,10 +52,21 @@ 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 *) kmalloc(THREAD_SIZE, GFP_KERNEL))
-#define free_thread_info(ti) kfree(ti)
+       ((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)
 
 #endif