Skip to content

Commit

Permalink
sparc: Use common threadinfo allocator
Browse files Browse the repository at this point in the history
Exaclty the same as the core code.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David S. Miller <davem@davemloft.net>
Link: http://lkml.kernel.org/r/20120505150142.252861878@linutronix.de
  • Loading branch information
Thomas Gleixner committed May 8, 2012
1 parent c4e2689 commit 66bb4cd
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions arch/sparc/include/asm/thread_info_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,32 +138,11 @@ register struct thread_info *current_thread_info_reg asm("g6");

/* thread information allocation */
#if PAGE_SHIFT == 13
#define __THREAD_INFO_ORDER 1
#define THREAD_SIZE_ORDER 1
#else /* PAGE_SHIFT == 13 */
#define __THREAD_INFO_ORDER 0
#define THREAD_SIZE_ORDER 0
#endif /* PAGE_SHIFT == 13 */

#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR

#ifdef CONFIG_DEBUG_STACK_USAGE
#define THREAD_FLAGS (GFP_KERNEL | __GFP_ZERO)
#else
#define THREAD_FLAGS (GFP_KERNEL)
#endif

#define alloc_thread_info_node(tsk, node) \
({ \
struct page *page = alloc_pages_node(node, THREAD_FLAGS, \
__THREAD_INFO_ORDER); \
struct thread_info *ret; \
\
ret = page ? page_address(page) : NULL; \
ret; \
})

#define free_thread_info(ti) \
free_pages((unsigned long)(ti),__THREAD_INFO_ORDER)

#define __thread_flag_byte_ptr(ti) \
((unsigned char *)(&((ti)->flags)))
#define __cur_thread_flag_byte_ptr __thread_flag_byte_ptr(current_thread_info())
Expand Down

0 comments on commit 66bb4cd

Please sign in to comment.