aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/include/asm/thread_info_64.h
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /arch/sparc/include/asm/thread_info_64.h
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'arch/sparc/include/asm/thread_info_64.h')
-rw-r--r--arch/sparc/include/asm/thread_info_64.h78
1 files changed, 39 insertions, 39 deletions
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h
index 269bd92313d..60d86be1a53 100644
--- a/arch/sparc/include/asm/thread_info_64.h
+++ b/arch/sparc/include/asm/thread_info_64.h
@@ -14,12 +14,12 @@
14#define TI_FLAG_FAULT_CODE_SHIFT 56 14#define TI_FLAG_FAULT_CODE_SHIFT 56
15#define TI_FLAG_BYTE_WSTATE 1 15#define TI_FLAG_BYTE_WSTATE 1
16#define TI_FLAG_WSTATE_SHIFT 48 16#define TI_FLAG_WSTATE_SHIFT 48
17#define TI_FLAG_BYTE_NOERROR 2 17#define TI_FLAG_BYTE_CWP 2
18#define TI_FLAG_BYTE_NOERROR_SHIFT 40 18#define TI_FLAG_CWP_SHIFT 40
19#define TI_FLAG_BYTE_FPDEPTH 3 19#define TI_FLAG_BYTE_CURRENT_DS 3
20#define TI_FLAG_FPDEPTH_SHIFT 32 20#define TI_FLAG_CURRENT_DS_SHIFT 32
21#define TI_FLAG_BYTE_CWP 4 21#define TI_FLAG_BYTE_FPDEPTH 4
22#define TI_FLAG_CWP_SHIFT 24 22#define TI_FLAG_FPDEPTH_SHIFT 24
23#define TI_FLAG_BYTE_WSAVED 5 23#define TI_FLAG_BYTE_WSAVED 5
24#define TI_FLAG_WSAVED_SHIFT 16 24#define TI_FLAG_WSAVED_SHIFT 16
25 25
@@ -47,7 +47,7 @@ struct thread_info {
47 struct exec_domain *exec_domain; 47 struct exec_domain *exec_domain;
48 int preempt_count; /* 0 => preemptable, <0 => BUG */ 48 int preempt_count; /* 0 => preemptable, <0 => BUG */
49 __u8 new_child; 49 __u8 new_child;
50 __u8 current_ds; 50 __u8 syscall_noerror;
51 __u16 cpu; 51 __u16 cpu;
52 52
53 unsigned long *utraps; 53 unsigned long *utraps;
@@ -74,9 +74,9 @@ struct thread_info {
74#define TI_FAULT_CODE (TI_FLAGS + TI_FLAG_BYTE_FAULT_CODE) 74#define TI_FAULT_CODE (TI_FLAGS + TI_FLAG_BYTE_FAULT_CODE)
75#define TI_WSTATE (TI_FLAGS + TI_FLAG_BYTE_WSTATE) 75#define TI_WSTATE (TI_FLAGS + TI_FLAG_BYTE_WSTATE)
76#define TI_CWP (TI_FLAGS + TI_FLAG_BYTE_CWP) 76#define TI_CWP (TI_FLAGS + TI_FLAG_BYTE_CWP)
77#define TI_CURRENT_DS (TI_FLAGS + TI_FLAG_BYTE_CURRENT_DS)
77#define TI_FPDEPTH (TI_FLAGS + TI_FLAG_BYTE_FPDEPTH) 78#define TI_FPDEPTH (TI_FLAGS + TI_FLAG_BYTE_FPDEPTH)
78#define TI_WSAVED (TI_FLAGS + TI_FLAG_BYTE_WSAVED) 79#define TI_WSAVED (TI_FLAGS + TI_FLAG_BYTE_WSAVED)
79#define TI_SYS_NOERROR (TI_FLAGS + TI_FLAG_BYTE_NOERROR)
80#define TI_FPSAVED 0x00000010 80#define TI_FPSAVED 0x00000010
81#define TI_KSP 0x00000018 81#define TI_KSP 0x00000018
82#define TI_FAULT_ADDR 0x00000020 82#define TI_FAULT_ADDR 0x00000020
@@ -84,7 +84,7 @@ struct thread_info {
84#define TI_EXEC_DOMAIN 0x00000030 84#define TI_EXEC_DOMAIN 0x00000030
85#define TI_PRE_COUNT 0x00000038 85#define TI_PRE_COUNT 0x00000038
86#define TI_NEW_CHILD 0x0000003c 86#define TI_NEW_CHILD 0x0000003c
87#define TI_CURRENT_DS 0x0000003d 87#define TI_SYS_NOERROR 0x0000003d
88#define TI_CPU 0x0000003e 88#define TI_CPU 0x0000003e
89#define TI_UTRAPS 0x00000040 89#define TI_UTRAPS 0x00000040
90#define TI_REG_WINDOW 0x00000048 90#define TI_REG_WINDOW 0x00000048
@@ -121,7 +121,7 @@ struct thread_info {
121#define INIT_THREAD_INFO(tsk) \ 121#define INIT_THREAD_INFO(tsk) \
122{ \ 122{ \
123 .task = &tsk, \ 123 .task = &tsk, \
124 .current_ds = ASI_P, \ 124 .flags = ((unsigned long)ASI_P) << TI_FLAG_CURRENT_DS_SHIFT, \
125 .exec_domain = &default_exec_domain, \ 125 .exec_domain = &default_exec_domain, \
126 .preempt_count = INIT_PREEMPT_COUNT, \ 126 .preempt_count = INIT_PREEMPT_COUNT, \
127 .restart_block = { \ 127 .restart_block = { \
@@ -138,11 +138,32 @@ register struct thread_info *current_thread_info_reg asm("g6");
138 138
139/* thread information allocation */ 139/* thread information allocation */
140#if PAGE_SHIFT == 13 140#if PAGE_SHIFT == 13
141#define THREAD_SIZE_ORDER 1 141#define __THREAD_INFO_ORDER 1
142#else /* PAGE_SHIFT == 13 */ 142#else /* PAGE_SHIFT == 13 */
143#define THREAD_SIZE_ORDER 0 143#define __THREAD_INFO_ORDER 0
144#endif /* PAGE_SHIFT == 13 */ 144#endif /* PAGE_SHIFT == 13 */
145 145
146#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
147
148#ifdef CONFIG_DEBUG_STACK_USAGE
149#define THREAD_FLAGS (GFP_KERNEL | __GFP_ZERO)
150#else
151#define THREAD_FLAGS (GFP_KERNEL)
152#endif
153
154#define alloc_thread_info_node(tsk, node) \
155({ \
156 struct page *page = alloc_pages_node(node, THREAD_FLAGS, \
157 __THREAD_INFO_ORDER); \
158 struct thread_info *ret; \
159 \
160 ret = page ? page_address(page) : NULL; \
161 ret; \
162})
163
164#define free_thread_info(ti) \
165 free_pages((unsigned long)(ti),__THREAD_INFO_ORDER)
166
146#define __thread_flag_byte_ptr(ti) \ 167#define __thread_flag_byte_ptr(ti) \
147 ((unsigned char *)(&((ti)->flags))) 168 ((unsigned char *)(&((ti)->flags)))
148#define __cur_thread_flag_byte_ptr __thread_flag_byte_ptr(current_thread_info()) 169#define __cur_thread_flag_byte_ptr __thread_flag_byte_ptr(current_thread_info())
@@ -153,12 +174,13 @@ register struct thread_info *current_thread_info_reg asm("g6");
153#define set_thread_wstate(val) (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_WSTATE] = (val)) 174#define set_thread_wstate(val) (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_WSTATE] = (val))
154#define get_thread_cwp() (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_CWP]) 175#define get_thread_cwp() (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_CWP])
155#define set_thread_cwp(val) (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_CWP] = (val)) 176#define set_thread_cwp(val) (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_CWP] = (val))
156#define get_thread_noerror() (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_NOERROR]) 177#define get_thread_current_ds() (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_CURRENT_DS])
157#define set_thread_noerror(val) (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_NOERROR] = (val)) 178#define set_thread_current_ds(val) (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_CURRENT_DS] = (val))
158#define get_thread_fpdepth() (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_FPDEPTH]) 179#define get_thread_fpdepth() (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_FPDEPTH])
159#define set_thread_fpdepth(val) (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_FPDEPTH] = (val)) 180#define set_thread_fpdepth(val) (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_FPDEPTH] = (val))
160#define get_thread_wsaved() (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_WSAVED]) 181#define get_thread_wsaved() (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_WSAVED])
161#define set_thread_wsaved(val) (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_WSAVED] = (val)) 182#define set_thread_wsaved(val) (__cur_thread_flag_byte_ptr[TI_FLAG_BYTE_WSAVED] = (val))
183
162#endif /* !(__ASSEMBLY__) */ 184#endif /* !(__ASSEMBLY__) */
163 185
164/* 186/*
@@ -203,6 +225,7 @@ register struct thread_info *current_thread_info_reg asm("g6");
203/* flag bit 12 is available */ 225/* flag bit 12 is available */
204#define TIF_MEMDIE 13 /* is terminating due to OOM killer */ 226#define TIF_MEMDIE 13 /* is terminating due to OOM killer */
205#define TIF_POLLING_NRFLAG 14 227#define TIF_POLLING_NRFLAG 14
228#define TIF_FREEZE 15 /* is freezing for suspend */
206 229
207#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 230#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
208#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 231#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -214,6 +237,7 @@ register struct thread_info *current_thread_info_reg asm("g6");
214#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 237#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
215#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT) 238#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)
216#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 239#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
240#define _TIF_FREEZE (1<<TIF_FREEZE)
217 241
218#define _TIF_USER_WORK_MASK ((0xff << TI_FLAG_WSAVED_SHIFT) | \ 242#define _TIF_USER_WORK_MASK ((0xff << TI_FLAG_WSAVED_SHIFT) | \
219 _TIF_DO_NOTIFY_RESUME_MASK | \ 243 _TIF_DO_NOTIFY_RESUME_MASK | \
@@ -237,32 +261,8 @@ static inline void set_restore_sigmask(void)
237{ 261{
238 struct thread_info *ti = current_thread_info(); 262 struct thread_info *ti = current_thread_info();
239 ti->status |= TS_RESTORE_SIGMASK; 263 ti->status |= TS_RESTORE_SIGMASK;
240 WARN_ON(!test_bit(TIF_SIGPENDING, &ti->flags)); 264 set_bit(TIF_SIGPENDING, &ti->flags);
241}
242static inline void clear_restore_sigmask(void)
243{
244 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
245} 265}
246static inline bool test_restore_sigmask(void)
247{
248 return current_thread_info()->status & TS_RESTORE_SIGMASK;
249}
250static inline bool test_and_clear_restore_sigmask(void)
251{
252 struct thread_info *ti = current_thread_info();
253 if (!(ti->status & TS_RESTORE_SIGMASK))
254 return false;
255 ti->status &= ~TS_RESTORE_SIGMASK;
256 return true;
257}
258
259#define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG)
260
261#define thread32_stack_is_64bit(__SP) (((__SP) & 0x1) != 0)
262#define test_thread_64bit_stack(__SP) \
263 ((test_thread_flag(TIF_32BIT) && !thread32_stack_is_64bit(__SP)) ? \
264 false : true)
265
266#endif /* !__ASSEMBLY__ */ 266#endif /* !__ASSEMBLY__ */
267 267
268#endif /* __KERNEL__ */ 268#endif /* __KERNEL__ */