1 #ifndef __ASM_SH_THREAD_INFO_H
2 #define __ASM_SH_THREAD_INFO_H
19 #define FAULT_CODE_WRITE (1 << 0)
20 #define FAULT_CODE_INITIAL (1 << 1)
21 #define FAULT_CODE_ITLB (1 << 2)
22 #define FAULT_CODE_PROT (1 << 3)
23 #define FAULT_CODE_USER (1 << 4)
26 #include <asm/processor.h>
37 unsigned long previous_sp;
44 #define PREEMPT_ACTIVE 0x10000000
46 #if defined(CONFIG_4KSTACKS)
47 #define THREAD_SHIFT 12
49 #define THREAD_SHIFT 13
52 #define THREAD_SIZE (1 << THREAD_SHIFT)
53 #define STACK_WARN (THREAD_SIZE >> 3)
59 #define INIT_THREAD_INFO(tsk) \
62 .exec_domain = &default_exec_domain, \
66 .preempt_count = INIT_PREEMPT_COUNT, \
67 .addr_limit = KERNEL_DS, \
69 .fn = do_no_restart_syscall, \
73 #define init_thread_info (init_thread_union.thread_info)
74 #define init_stack (init_thread_union.stack)
77 register unsigned long current_stack_pointer
asm(
"r15")
__used;
83 #if defined(CONFIG_SUPERH64)
84 __asm__ __volatile__ (
"getcon cr17, %0" :
"=r" (ti));
85 #elif defined(CONFIG_CPU_HAS_SR_RB)
86 __asm__ __volatile__ (
"stc r7_bank, %0" :
"=r" (ti));
88 unsigned long __dummy;
93 :
"=&r" (ti),
"=r" (__dummy)
101 #define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
119 #define TIF_SYSCALL_TRACE 0
120 #define TIF_SIGPENDING 1
121 #define TIF_NEED_RESCHED 2
122 #define TIF_SINGLESTEP 4
123 #define TIF_SYSCALL_AUDIT 5
124 #define TIF_SECCOMP 6
125 #define TIF_NOTIFY_RESUME 7
126 #define TIF_SYSCALL_TRACEPOINT 8
127 #define TIF_POLLING_NRFLAG 17
128 #define TIF_MEMDIE 18
130 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
131 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
132 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
133 #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
134 #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
135 #define _TIF_SECCOMP (1 << TIF_SECCOMP)
136 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
137 #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
138 #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
141 #define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \
142 _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \
143 _TIF_SYSCALL_TRACEPOINT)
146 #define _TIF_ALLWORK_MASK (_TIF_SYSCALL_TRACE | _TIF_SIGPENDING | \
147 _TIF_NEED_RESCHED | _TIF_SYSCALL_AUDIT | \
148 _TIF_SINGLESTEP | _TIF_NOTIFY_RESUME | \
149 _TIF_SYSCALL_TRACEPOINT)
152 #define _TIF_WORK_MASK (_TIF_ALLWORK_MASK & ~(_TIF_SYSCALL_TRACE | \
153 _TIF_SYSCALL_AUDIT | _TIF_SINGLESTEP))
162 #define TS_RESTORE_SIGMASK 0x0001
163 #define TS_USEDFPU 0x0002
167 #define HAVE_SET_RESTORE_SIGMASK 1
168 static inline void set_restore_sigmask(
void)
175 #define TI_FLAG_FAULT_CODE_SHIFT 24
180 static inline void set_thread_fault_code(
unsigned int val)
183 ti->
flags = (ti->
flags & (~0 >> (32 - TI_FLAG_FAULT_CODE_SHIFT)))
184 | (val << TI_FLAG_FAULT_CODE_SHIFT);
187 static inline unsigned int get_thread_fault_code(
void)
190 return ti->
flags >> TI_FLAG_FAULT_CODE_SHIFT;
193 static inline void clear_restore_sigmask(
void)
197 static inline bool test_restore_sigmask(
void)
201 static inline bool test_and_clear_restore_sigmask(
void)
210 #define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG)