[PATCH 2.6.10-rc3-mm1] m32r: Use kmalloc for m32r stacks (2/2)

From: Hirokazu Takata
Date: Fri Dec 17 2004 - 06:16:41 EST


[PATCH 2.6.10-rc3-mm1] m32r: Use kmalloc for m32r stacks (2/2)
- Use kmalloc for m32r stacks (cf. changeset 1.1046.533.10)
- Update for CONFIG_DEBUG_STACK_USAGE

This modification was taken from include/asm-i386/thread_info.h.

Signed-off-by: Hirokazu Takata <takata@xxxxxxxxxxxxxx>
---

include/asm-m32r/thread_info.h | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)


diff -ruNp a/include/asm-m32r/thread_info.h b/include/asm-m32r/thread_info.h
--- a/include/asm-m32r/thread_info.h 2004-12-16 13:41:57.000000000 +0900
+++ b/include/asm-m32r/thread_info.h 2004-12-16 13:42:32.000000000 +0900
@@ -95,9 +95,21 @@ static inline struct thread_info *curren
}

/* thread information allocation */
-#define alloc_thread_info(task) \
- ((struct thread_info *) __get_free_pages(GFP_KERNEL,1))
-#define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
+#if CONFIG_DEBUG_STACK_USAGE
+#define alloc_thread_info(tsk) \
+ ({ \
+ struct thread_info *ret; \
+ \
+ ret = kmalloc(THREAD_SIZE, GFP_KERNEL); \
+ if (ret) \
+ memset(ret, 0, THREAD_SIZE); \
+ ret; \
+ })
+#else
+#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL)
+#endif
+
+#define free_thread_info(info) kfree(info)
#define get_thread_info(ti) get_task_struct((ti)->task)
#define put_thread_info(ti) put_task_struct((ti)->task)

--
Hirokazu Takata <takata@xxxxxxxxxxxxxx>
Linux/M32R Project: http://www.linux-m32r.org/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/