diff options
Diffstat (limited to 'include/asm-x86_64/thread_info.h')
-rw-r--r-- | include/asm-x86_64/thread_info.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/include/asm-x86_64/thread_info.h b/include/asm-x86_64/thread_info.h index 4ac0e0a36934..2029b00351f3 100644 --- a/include/asm-x86_64/thread_info.h +++ b/include/asm-x86_64/thread_info.h | |||
@@ -73,8 +73,21 @@ static inline struct thread_info *stack_thread_info(void) | |||
73 | } | 73 | } |
74 | 74 | ||
75 | /* thread information allocation */ | 75 | /* thread information allocation */ |
76 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
77 | #define alloc_thread_info(tsk) \ | ||
78 | ({ \ | ||
79 | struct thread_info *ret; \ | ||
80 | \ | ||
81 | ret = ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)); \ | ||
82 | if (ret) \ | ||
83 | memset(ret, 0, THREAD_SIZE); \ | ||
84 | ret; \ | ||
85 | }) | ||
86 | #else | ||
76 | #define alloc_thread_info(tsk) \ | 87 | #define alloc_thread_info(tsk) \ |
77 | ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)) | 88 | ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)) |
89 | #endif | ||
90 | |||
78 | #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER) | 91 | #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER) |
79 | 92 | ||
80 | #else /* !__ASSEMBLY__ */ | 93 | #else /* !__ASSEMBLY__ */ |
@@ -101,7 +114,7 @@ static inline struct thread_info *stack_thread_info(void) | |||
101 | #define TIF_IRET 5 /* force IRET */ | 114 | #define TIF_IRET 5 /* force IRET */ |
102 | #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ | 115 | #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ |
103 | #define TIF_SECCOMP 8 /* secure computing */ | 116 | #define TIF_SECCOMP 8 /* secure computing */ |
104 | #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 117 | /* 16 free */ |
105 | #define TIF_IA32 17 /* 32bit process */ | 118 | #define TIF_IA32 17 /* 32bit process */ |
106 | #define TIF_FORK 18 /* ret_from_fork */ | 119 | #define TIF_FORK 18 /* ret_from_fork */ |
107 | #define TIF_ABI_PENDING 19 | 120 | #define TIF_ABI_PENDING 19 |
@@ -115,7 +128,6 @@ static inline struct thread_info *stack_thread_info(void) | |||
115 | #define _TIF_IRET (1<<TIF_IRET) | 128 | #define _TIF_IRET (1<<TIF_IRET) |
116 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | 129 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) |
117 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | 130 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) |
118 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | ||
119 | #define _TIF_IA32 (1<<TIF_IA32) | 131 | #define _TIF_IA32 (1<<TIF_IA32) |
120 | #define _TIF_FORK (1<<TIF_FORK) | 132 | #define _TIF_FORK (1<<TIF_FORK) |
121 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) | 133 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) |
@@ -137,6 +149,9 @@ static inline struct thread_info *stack_thread_info(void) | |||
137 | */ | 149 | */ |
138 | #define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ | 150 | #define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ |
139 | #define TS_COMPAT 0x0002 /* 32bit syscall active */ | 151 | #define TS_COMPAT 0x0002 /* 32bit syscall active */ |
152 | #define TS_POLLING 0x0004 /* true if in idle loop and not sleeping */ | ||
153 | |||
154 | #define tsk_is_polling(t) ((t)->thread_info->status & TS_POLLING) | ||
140 | 155 | ||
141 | #endif /* __KERNEL__ */ | 156 | #endif /* __KERNEL__ */ |
142 | 157 | ||