aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/thread_info.h
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-07-25 04:45:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 13:53:28 -0400
commitb69c49b78457f681ecfb3147bd968434ee6559c1 (patch)
tree9557c950c21cf4336ccc403136ea11384150af31 /include/asm-powerpc/thread_info.h
parent62ec30d45ecbb85b5991474c8f04192697687495 (diff)
clean up duplicated alloc/free_thread_info
We duplicate alloc/free_thread_info defines on many platforms (the majority uses __get_free_pages/free_pages). This patch defines common defines and removes these duplicated defines. __HAVE_ARCH_THREAD_INFO_ALLOCATOR is introduced for platforms that do something different. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Pekka Enberg <penberg@cs.helsinki.fi> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-powerpc/thread_info.h')
-rw-r--r--include/asm-powerpc/thread_info.h14
1 files changed, 3 insertions, 11 deletions
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h
index b705c2a7651a..a9db562df69a 100644
--- a/include/asm-powerpc/thread_info.h
+++ b/include/asm-powerpc/thread_info.h
@@ -66,20 +66,12 @@ struct thread_info {
66 66
67#if THREAD_SHIFT >= PAGE_SHIFT 67#if THREAD_SHIFT >= PAGE_SHIFT
68 68
69#define THREAD_ORDER (THREAD_SHIFT - PAGE_SHIFT) 69#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
70
71#ifdef CONFIG_DEBUG_STACK_USAGE
72#define alloc_thread_info(tsk) \
73 ((struct thread_info *)__get_free_pages(GFP_KERNEL | \
74 __GFP_ZERO, THREAD_ORDER))
75#else
76#define alloc_thread_info(tsk) \
77 ((struct thread_info *)__get_free_pages(GFP_KERNEL, THREAD_ORDER))
78#endif
79#define free_thread_info(ti) free_pages((unsigned long)ti, THREAD_ORDER)
80 70
81#else /* THREAD_SHIFT < PAGE_SHIFT */ 71#else /* THREAD_SHIFT < PAGE_SHIFT */
82 72
73#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
74
83extern struct thread_info *alloc_thread_info(struct task_struct *tsk); 75extern struct thread_info *alloc_thread_info(struct task_struct *tsk);
84extern void free_thread_info(struct thread_info *ti); 76extern void free_thread_info(struct thread_info *ti);
85 77