7 #ifndef _LINUX_THREAD_INFO_H
8 #define _LINUX_THREAD_INFO_H
10 #include <linux/types.h>
53 #include <linux/bitops.h>
54 #include <asm/thread_info.h>
58 #ifdef CONFIG_DEBUG_STACK_USAGE
59 # define THREADINFO_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO)
61 # define THREADINFO_GFP (GFP_KERNEL | __GFP_NOTRACK)
74 static inline void clear_ti_thread_flag(
struct thread_info *ti,
int flag)
79 static inline int test_and_set_ti_thread_flag(
struct thread_info *ti,
int flag)
84 static inline int test_and_clear_ti_thread_flag(
struct thread_info *ti,
int flag)
89 static inline int test_ti_thread_flag(
struct thread_info *ti,
int flag)
94 #define set_thread_flag(flag) \
95 set_ti_thread_flag(current_thread_info(), flag)
96 #define clear_thread_flag(flag) \
97 clear_ti_thread_flag(current_thread_info(), flag)
98 #define test_and_set_thread_flag(flag) \
99 test_and_set_ti_thread_flag(current_thread_info(), flag)
100 #define test_and_clear_thread_flag(flag) \
101 test_and_clear_ti_thread_flag(current_thread_info(), flag)
102 #define test_thread_flag(flag) \
103 test_ti_thread_flag(current_thread_info(), flag)
105 #define set_need_resched() set_thread_flag(TIF_NEED_RESCHED)
106 #define clear_need_resched() clear_thread_flag(TIF_NEED_RESCHED)
108 #if defined TIF_RESTORE_SIGMASK && !defined HAVE_SET_RESTORE_SIGMASK
113 #define HAVE_SET_RESTORE_SIGMASK 1
126 static inline void set_restore_sigmask(
void)
131 static inline void clear_restore_sigmask(
void)
135 static inline bool test_restore_sigmask(
void)
139 static inline bool test_and_clear_restore_sigmask(
void)
145 #ifndef HAVE_SET_RESTORE_SIGMASK
146 #error "no set_restore_sigmask() provided and default one won't work"