0001
0002
0003 #ifndef _ASM_CSKY_THREAD_INFO_H
0004 #define _ASM_CSKY_THREAD_INFO_H
0005
0006 #ifndef __ASSEMBLY__
0007
0008 #include <asm/types.h>
0009 #include <asm/page.h>
0010 #include <asm/processor.h>
0011 #include <abi/switch_context.h>
0012
0013 struct thread_info {
0014 struct task_struct *task;
0015 void *dump_exec_domain;
0016 unsigned long flags;
0017 int preempt_count;
0018 unsigned long tp_value;
0019 struct restart_block restart_block;
0020 struct pt_regs *regs;
0021 unsigned int cpu;
0022 };
0023
0024 #define INIT_THREAD_INFO(tsk) \
0025 { \
0026 .task = &tsk, \
0027 .preempt_count = INIT_PREEMPT_COUNT, \
0028 .cpu = 0, \
0029 .restart_block = { \
0030 .fn = do_no_restart_syscall, \
0031 }, \
0032 }
0033
0034 #define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
0035
0036 #define thread_saved_fp(tsk) \
0037 ((unsigned long)(((struct switch_stack *)(tsk->thread.sp))->r8))
0038
0039 #define thread_saved_sp(tsk) \
0040 ((unsigned long)(tsk->thread.sp))
0041
0042 #define thread_saved_lr(tsk) \
0043 ((unsigned long)(((struct switch_stack *)(tsk->thread.sp))->r15))
0044
0045 static inline struct thread_info *current_thread_info(void)
0046 {
0047 unsigned long sp;
0048
0049 asm volatile("mov %0, sp\n":"=r"(sp));
0050
0051 return (struct thread_info *)(sp & ~(THREAD_SIZE - 1));
0052 }
0053
0054 #endif
0055
0056 #define TIF_SIGPENDING 0
0057 #define TIF_NOTIFY_RESUME 1
0058 #define TIF_NEED_RESCHED 2
0059 #define TIF_UPROBE 3
0060 #define TIF_SYSCALL_TRACE 4
0061 #define TIF_SYSCALL_TRACEPOINT 5
0062 #define TIF_SYSCALL_AUDIT 6
0063 #define TIF_NOTIFY_SIGNAL 7
0064 #define TIF_POLLING_NRFLAG 16
0065 #define TIF_MEMDIE 18
0066 #define TIF_RESTORE_SIGMASK 20
0067 #define TIF_SECCOMP 21
0068
0069 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
0070 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
0071 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
0072 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
0073 #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
0074 #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
0075 #define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
0076 #define _TIF_UPROBE (1 << TIF_UPROBE)
0077 #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
0078 #define _TIF_MEMDIE (1 << TIF_MEMDIE)
0079 #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
0080 #define _TIF_SECCOMP (1 << TIF_SECCOMP)
0081
0082 #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
0083 _TIF_NOTIFY_RESUME | _TIF_UPROBE | \
0084 _TIF_NOTIFY_SIGNAL)
0085
0086 #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
0087 _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP)
0088
0089 #endif