Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11674
b: refs/heads/master
c: 328985b
h: refs/heads/master
v: v3
  • Loading branch information
David Gibson authored and Paul Mackerras committed Oct 27, 2005
1 parent f2700a5 commit 8d96721
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2765ca254060adb9a5abc2cfc6264b8daafc5742
refs/heads/master: 328985b2c69d2592edd7f181a6b7360e51b08515
27 changes: 17 additions & 10 deletions trunk/include/asm-powerpc/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,26 @@ struct thread_info {
/* thread information allocation */

#ifdef 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; \
})
#define THREAD_INFO_GFP GFP_KERNEL | __GFP_ZERO
#else
#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL)
#define THREAD_INFO_GFP GFP_KERNEL
#endif

#if THREAD_SHIFT >= PAGE_SHIFT

#define THREAD_ORDER (THREAD_SHIFT - PAGE_SHIFT)

#define alloc_thread_info(tsk) \
((struct thread_info *)__get_free_pages(THREAD_INFO_GFP, THREAD_ORDER))
#define free_thread_info(ti) free_pages((unsigned long)ti, THREAD_ORDER)

#else /* THREAD_SHIFT < PAGE_SHIFT */

#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, THREAD_INFO_GFP)
#define free_thread_info(ti) kfree(ti)

#endif /* THREAD_SHIFT < PAGE_SHIFT */

#define get_thread_info(ti) get_task_struct((ti)->task)
#define put_thread_info(ti) put_task_struct((ti)->task)

Expand Down

0 comments on commit 8d96721

Please sign in to comment.