This source file includes following definitions.
- test_thread_local_flags
1
2
3
4
5
6
7
8
9 #ifndef _ASM_POWERPC_THREAD_INFO_H
10 #define _ASM_POWERPC_THREAD_INFO_H
11
12 #include <asm/asm-const.h>
13
14 #ifdef __KERNEL__
15
16 #define THREAD_SHIFT CONFIG_THREAD_SHIFT
17
18 #define THREAD_SIZE (1 << THREAD_SHIFT)
19
20 #ifndef __ASSEMBLY__
21 #include <linux/cache.h>
22 #include <asm/processor.h>
23 #include <asm/page.h>
24 #include <asm/accounting.h>
25
26 #define SLB_PRELOAD_NR 16U
27
28
29
30 struct thread_info {
31 int preempt_count;
32
33 unsigned long local_flags;
34 #ifdef CONFIG_LIVEPATCH
35 unsigned long *livepatch_sp;
36 #endif
37 #if defined(CONFIG_VIRT_CPU_ACCOUNTING_NATIVE) && defined(CONFIG_PPC32)
38 struct cpu_accounting_data accounting;
39 #endif
40 unsigned char slb_preload_nr;
41 unsigned char slb_preload_tail;
42 u32 slb_preload_esid[SLB_PRELOAD_NR];
43
44
45 unsigned long flags ____cacheline_aligned_in_smp;
46 };
47
48
49
50
51 #define INIT_THREAD_INFO(tsk) \
52 { \
53 .preempt_count = INIT_PREEMPT_COUNT, \
54 .flags = 0, \
55 }
56
57 #define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
58
59
60 extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
61
62 #ifdef CONFIG_PPC_BOOK3S_64
63 void arch_setup_new_exec(void);
64 #define arch_setup_new_exec arch_setup_new_exec
65 #endif
66
67 #endif
68
69
70
71
72 #define TIF_SYSCALL_TRACE 0
73 #define TIF_SIGPENDING 1
74 #define TIF_NEED_RESCHED 2
75 #define TIF_FSCHECK 3
76 #define TIF_SYSCALL_EMU 4
77 #define TIF_RESTORE_TM 5
78 #define TIF_PATCH_PENDING 6
79 #define TIF_SYSCALL_AUDIT 7
80 #define TIF_SINGLESTEP 8
81 #define TIF_NOHZ 9
82 #define TIF_SECCOMP 10
83 #define TIF_RESTOREALL 11
84 #define TIF_NOERROR 12
85 #define TIF_NOTIFY_RESUME 13
86 #define TIF_UPROBE 14
87 #define TIF_SYSCALL_TRACEPOINT 15
88 #define TIF_EMULATE_STACK_STORE 16
89
90 #define TIF_MEMDIE 17
91 #if defined(CONFIG_PPC64)
92 #define TIF_ELF2ABI 18
93 #endif
94 #define TIF_POLLING_NRFLAG 19
95 #define TIF_32BIT 20
96
97
98 #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
99 #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
100 #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
101 #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
102 #define _TIF_32BIT (1<<TIF_32BIT)
103 #define _TIF_RESTORE_TM (1<<TIF_RESTORE_TM)
104 #define _TIF_PATCH_PENDING (1<<TIF_PATCH_PENDING)
105 #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
106 #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
107 #define _TIF_SECCOMP (1<<TIF_SECCOMP)
108 #define _TIF_RESTOREALL (1<<TIF_RESTOREALL)
109 #define _TIF_NOERROR (1<<TIF_NOERROR)
110 #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
111 #define _TIF_UPROBE (1<<TIF_UPROBE)
112 #define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)
113 #define _TIF_EMULATE_STACK_STORE (1<<TIF_EMULATE_STACK_STORE)
114 #define _TIF_NOHZ (1<<TIF_NOHZ)
115 #define _TIF_FSCHECK (1<<TIF_FSCHECK)
116 #define _TIF_SYSCALL_EMU (1<<TIF_SYSCALL_EMU)
117 #define _TIF_SYSCALL_DOTRACE (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
118 _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT | \
119 _TIF_NOHZ | _TIF_SYSCALL_EMU)
120
121 #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
122 _TIF_NOTIFY_RESUME | _TIF_UPROBE | \
123 _TIF_RESTORE_TM | _TIF_PATCH_PENDING | \
124 _TIF_FSCHECK)
125 #define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR)
126
127
128
129 #define TLF_NAPPING 0
130 #define TLF_SLEEPING 1
131 #define TLF_LAZY_MMU 3
132 #define TLF_RUNLATCH 4
133
134 #define _TLF_NAPPING (1 << TLF_NAPPING)
135 #define _TLF_SLEEPING (1 << TLF_SLEEPING)
136 #define _TLF_LAZY_MMU (1 << TLF_LAZY_MMU)
137 #define _TLF_RUNLATCH (1 << TLF_RUNLATCH)
138
139 #ifndef __ASSEMBLY__
140
141 static inline bool test_thread_local_flags(unsigned int flags)
142 {
143 struct thread_info *ti = current_thread_info();
144 return (ti->local_flags & flags) != 0;
145 }
146
147 #ifdef CONFIG_PPC64
148 #define is_32bit_task() (test_thread_flag(TIF_32BIT))
149 #else
150 #define is_32bit_task() (1)
151 #endif
152
153 #if defined(CONFIG_PPC64)
154 #define is_elf2_task() (test_thread_flag(TIF_ELF2ABI))
155 #else
156 #define is_elf2_task() (0)
157 #endif
158
159 #endif
160
161 #endif
162
163 #endif