1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
4 #ifndef _ASM_CSKY_THREAD_INFO_H
5 #define _ASM_CSKY_THREAD_INFO_H
9 #include <linux/version.h>
10 #include <asm/types.h>
12 #include <asm/processor.h>
13 #include <abi/switch_context.h>
16 struct task_struct
*task
;
17 void *dump_exec_domain
;
20 unsigned long tp_value
;
21 mm_segment_t addr_limit
;
22 struct restart_block restart_block
;
27 #define INIT_THREAD_INFO(tsk) \
30 .preempt_count = INIT_PREEMPT_COUNT, \
31 .addr_limit = KERNEL_DS, \
34 .fn = do_no_restart_syscall, \
38 #define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
40 #define thread_saved_fp(tsk) \
41 ((unsigned long)(((struct switch_stack *)(tsk->thread.ksp))->r8))
43 static inline struct thread_info
*current_thread_info(void)
47 asm volatile("mov %0, sp\n":"=r"(sp
));
49 return (struct thread_info
*)(sp
& ~(THREAD_SIZE
- 1));
52 #endif /* !__ASSEMBLY__ */
54 #define TIF_SIGPENDING 0 /* signal pending */
55 #define TIF_NOTIFY_RESUME 1 /* callback before returning to user */
56 #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
57 #define TIF_SYSCALL_TRACE 3 /* syscall trace active */
58 #define TIF_SYSCALL_TRACEPOINT 4 /* syscall tracepoint instrumentation */
59 #define TIF_SYSCALL_AUDIT 5 /* syscall auditing */
60 #define TIF_POLLING_NRFLAG 16 /* poll_idle() is TIF_NEED_RESCHED */
61 #define TIF_MEMDIE 18 /* is terminating due to OOM killer */
62 #define TIF_RESTORE_SIGMASK 20 /* restore signal mask in do_signal() */
63 #define TIF_SECCOMP 21 /* secure computing */
65 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
66 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
67 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
68 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
69 #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
70 #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
71 #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
72 #define _TIF_MEMDIE (1 << TIF_MEMDIE)
73 #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
74 #define _TIF_SECCOMP (1 << TIF_SECCOMP)
76 #endif /* _ASM_CSKY_THREAD_INFO_H */