0001
0002
0003
0004
0005
0006 #ifndef __UM_THREAD_INFO_H
0007 #define __UM_THREAD_INFO_H
0008
0009 #define THREAD_SIZE_ORDER CONFIG_KERNEL_STACK_ORDER
0010 #define THREAD_SIZE ((1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE)
0011
0012 #ifndef __ASSEMBLY__
0013
0014 #include <asm/types.h>
0015 #include <asm/page.h>
0016 #include <asm/segment.h>
0017 #include <sysdep/ptrace_user.h>
0018
0019 struct thread_info {
0020 struct task_struct *task;
0021 unsigned long flags;
0022 __u32 cpu;
0023 int preempt_count;
0024
0025 struct thread_info *real_thread;
0026 unsigned long aux_fp_regs[FP_SIZE];
0027
0028 };
0029
0030 #define INIT_THREAD_INFO(tsk) \
0031 { \
0032 .task = &tsk, \
0033 .flags = 0, \
0034 .cpu = 0, \
0035 .preempt_count = INIT_PREEMPT_COUNT, \
0036 .real_thread = NULL, \
0037 }
0038
0039
0040 static inline struct thread_info *current_thread_info(void)
0041 {
0042 struct thread_info *ti;
0043 unsigned long mask = THREAD_SIZE - 1;
0044 void *p;
0045
0046 asm volatile ("" : "=r" (p) : "0" (&ti));
0047 ti = (struct thread_info *) (((unsigned long)p) & ~mask);
0048 return ti;
0049 }
0050
0051 #endif
0052
0053 #define TIF_SYSCALL_TRACE 0
0054 #define TIF_SIGPENDING 1
0055 #define TIF_NEED_RESCHED 2
0056 #define TIF_NOTIFY_SIGNAL 3
0057 #define TIF_RESTART_BLOCK 4
0058 #define TIF_MEMDIE 5
0059 #define TIF_SYSCALL_AUDIT 6
0060 #define TIF_RESTORE_SIGMASK 7
0061 #define TIF_NOTIFY_RESUME 8
0062 #define TIF_SECCOMP 9
0063 #define TIF_SINGLESTEP 10
0064
0065 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
0066 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
0067 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
0068 #define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
0069 #define _TIF_MEMDIE (1 << TIF_MEMDIE)
0070 #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
0071 #define _TIF_SECCOMP (1 << TIF_SECCOMP)
0072 #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
0073
0074 #endif