diff options
Diffstat (limited to 'include/asm-x86/thread_info_32.h')
-rw-r--r-- | include/asm-x86/thread_info_32.h | 88 |
1 files changed, 46 insertions, 42 deletions
diff --git a/include/asm-x86/thread_info_32.h b/include/asm-x86/thread_info_32.h index 5bd508260ffb..4e053fa561a9 100644 --- a/include/asm-x86/thread_info_32.h +++ b/include/asm-x86/thread_info_32.h | |||
@@ -20,7 +20,8 @@ | |||
20 | * low level task data that entry.S needs immediate access to | 20 | * low level task data that entry.S needs immediate access to |
21 | * - this struct should fit entirely inside of one cache line | 21 | * - this struct should fit entirely inside of one cache line |
22 | * - this struct shares the supervisor stack pages | 22 | * - this struct shares the supervisor stack pages |
23 | * - if the contents of this structure are changed, the assembly constants must also be changed | 23 | * - if the contents of this structure are changed, |
24 | * the assembly constants must also be changed | ||
24 | */ | 25 | */ |
25 | #ifndef __ASSEMBLY__ | 26 | #ifndef __ASSEMBLY__ |
26 | 27 | ||
@@ -30,18 +31,16 @@ struct thread_info { | |||
30 | unsigned long flags; /* low level flags */ | 31 | unsigned long flags; /* low level flags */ |
31 | unsigned long status; /* thread-synchronous flags */ | 32 | unsigned long status; /* thread-synchronous flags */ |
32 | __u32 cpu; /* current CPU */ | 33 | __u32 cpu; /* current CPU */ |
33 | int preempt_count; /* 0 => preemptable, <0 => BUG */ | 34 | int preempt_count; /* 0 => preemptable, |
34 | 35 | <0 => BUG */ | |
35 | |||
36 | mm_segment_t addr_limit; /* thread address space: | 36 | mm_segment_t addr_limit; /* thread address space: |
37 | 0-0xBFFFFFFF for user-thead | 37 | 0-0xBFFFFFFF user-thread |
38 | 0-0xFFFFFFFF for kernel-thread | 38 | 0-0xFFFFFFFF kernel-thread |
39 | */ | 39 | */ |
40 | void *sysenter_return; | 40 | void *sysenter_return; |
41 | struct restart_block restart_block; | 41 | struct restart_block restart_block; |
42 | 42 | unsigned long previous_esp; /* ESP of the previous stack in | |
43 | unsigned long previous_esp; /* ESP of the previous stack in case | 43 | case of nested (IRQ) stacks |
44 | of nested (IRQ) stacks | ||
45 | */ | 44 | */ |
46 | __u8 supervisor_stack[0]; | 45 | __u8 supervisor_stack[0]; |
47 | }; | 46 | }; |
@@ -90,15 +89,16 @@ register unsigned long current_stack_pointer asm("esp") __used; | |||
90 | /* how to get the thread information struct from C */ | 89 | /* how to get the thread information struct from C */ |
91 | static inline struct thread_info *current_thread_info(void) | 90 | static inline struct thread_info *current_thread_info(void) |
92 | { | 91 | { |
93 | return (struct thread_info *)(current_stack_pointer & ~(THREAD_SIZE - 1)); | 92 | return (struct thread_info *) |
93 | (current_stack_pointer & ~(THREAD_SIZE - 1)); | ||
94 | } | 94 | } |
95 | 95 | ||
96 | /* thread information allocation */ | 96 | /* thread information allocation */ |
97 | #ifdef CONFIG_DEBUG_STACK_USAGE | 97 | #ifdef CONFIG_DEBUG_STACK_USAGE |
98 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | 98 | #define alloc_thread_info(tsk) ((struct thread_info *) \ |
99 | __get_free_pages(GFP_KERNEL| __GFP_ZERO, get_order(THREAD_SIZE))) | 99 | __get_free_pages(GFP_KERNEL | __GFP_ZERO, get_order(THREAD_SIZE))) |
100 | #else | 100 | #else |
101 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | 101 | #define alloc_thread_info(tsk) ((struct thread_info *) \ |
102 | __get_free_pages(GFP_KERNEL, get_order(THREAD_SIZE))) | 102 | __get_free_pages(GFP_KERNEL, get_order(THREAD_SIZE))) |
103 | #endif | 103 | #endif |
104 | 104 | ||
@@ -107,7 +107,7 @@ static inline struct thread_info *current_thread_info(void) | |||
107 | #else /* !__ASSEMBLY__ */ | 107 | #else /* !__ASSEMBLY__ */ |
108 | 108 | ||
109 | /* how to get the thread information struct from ASM */ | 109 | /* how to get the thread information struct from ASM */ |
110 | #define GET_THREAD_INFO(reg) \ | 110 | #define GET_THREAD_INFO(reg) \ |
111 | movl $-THREAD_SIZE, reg; \ | 111 | movl $-THREAD_SIZE, reg; \ |
112 | andl %esp, reg | 112 | andl %esp, reg |
113 | 113 | ||
@@ -119,14 +119,16 @@ static inline struct thread_info *current_thread_info(void) | |||
119 | 119 | ||
120 | /* | 120 | /* |
121 | * thread information flags | 121 | * thread information flags |
122 | * - these are process state flags that various assembly files may need to access | 122 | * - these are process state flags that various |
123 | * assembly files may need to access | ||
123 | * - pending work-to-be-done flags are in LSW | 124 | * - pending work-to-be-done flags are in LSW |
124 | * - other flags in MSW | 125 | * - other flags in MSW |
125 | */ | 126 | */ |
126 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ | 127 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ |
127 | #define TIF_SIGPENDING 1 /* signal pending */ | 128 | #define TIF_SIGPENDING 1 /* signal pending */ |
128 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ | 129 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ |
129 | #define TIF_SINGLESTEP 3 /* restore singlestep on return to user mode */ | 130 | #define TIF_SINGLESTEP 3 /* restore singlestep on return to |
131 | user mode */ | ||
130 | #define TIF_IRET 4 /* return with iret */ | 132 | #define TIF_IRET 4 /* return with iret */ |
131 | #define TIF_SYSCALL_EMU 5 /* syscall emulation active */ | 133 | #define TIF_SYSCALL_EMU 5 /* syscall emulation active */ |
132 | #define TIF_SYSCALL_AUDIT 6 /* syscall auditing active */ | 134 | #define TIF_SYSCALL_AUDIT 6 /* syscall auditing active */ |
@@ -143,36 +145,36 @@ static inline struct thread_info *current_thread_info(void) | |||
143 | #define TIF_DS_AREA_MSR 23 /* uses thread_struct.ds_area_msr */ | 145 | #define TIF_DS_AREA_MSR 23 /* uses thread_struct.ds_area_msr */ |
144 | #define TIF_BTS_TRACE_TS 24 /* record scheduling event timestamps */ | 146 | #define TIF_BTS_TRACE_TS 24 /* record scheduling event timestamps */ |
145 | 147 | ||
146 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 148 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
147 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) | 149 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
148 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 150 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) |
149 | #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) | 151 | #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) |
150 | #define _TIF_IRET (1<<TIF_IRET) | 152 | #define _TIF_IRET (1 << TIF_IRET) |
151 | #define _TIF_SYSCALL_EMU (1<<TIF_SYSCALL_EMU) | 153 | #define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU) |
152 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | 154 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) |
153 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | 155 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) |
154 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | 156 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) |
155 | #define _TIF_HRTICK_RESCHED (1<<TIF_HRTICK_RESCHED) | 157 | #define _TIF_HRTICK_RESCHED (1 << TIF_HRTICK_RESCHED) |
156 | #define _TIF_DEBUG (1<<TIF_DEBUG) | 158 | #define _TIF_DEBUG (1 << TIF_DEBUG) |
157 | #define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP) | 159 | #define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP) |
158 | #define _TIF_FREEZE (1<<TIF_FREEZE) | 160 | #define _TIF_FREEZE (1 << TIF_FREEZE) |
159 | #define _TIF_NOTSC (1<<TIF_NOTSC) | 161 | #define _TIF_NOTSC (1 << TIF_NOTSC) |
160 | #define _TIF_FORCED_TF (1<<TIF_FORCED_TF) | 162 | #define _TIF_FORCED_TF (1 << TIF_FORCED_TF) |
161 | #define _TIF_DEBUGCTLMSR (1<<TIF_DEBUGCTLMSR) | 163 | #define _TIF_DEBUGCTLMSR (1 << TIF_DEBUGCTLMSR) |
162 | #define _TIF_DS_AREA_MSR (1<<TIF_DS_AREA_MSR) | 164 | #define _TIF_DS_AREA_MSR (1 << TIF_DS_AREA_MSR) |
163 | #define _TIF_BTS_TRACE_TS (1<<TIF_BTS_TRACE_TS) | 165 | #define _TIF_BTS_TRACE_TS (1 << TIF_BTS_TRACE_TS) |
164 | 166 | ||
165 | /* work to do on interrupt/exception return */ | 167 | /* work to do on interrupt/exception return */ |
166 | #define _TIF_WORK_MASK \ | 168 | #define _TIF_WORK_MASK \ |
167 | (0x0000FFFF & ~(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ | 169 | (0x0000FFFF & ~(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ |
168 | _TIF_SECCOMP | _TIF_SYSCALL_EMU)) | 170 | _TIF_SECCOMP | _TIF_SYSCALL_EMU)) |
169 | /* work to do on any return to u-space */ | 171 | /* work to do on any return to u-space */ |
170 | #define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) | 172 | #define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) |
171 | 173 | ||
172 | /* flags to check in __switch_to() */ | 174 | /* flags to check in __switch_to() */ |
173 | #define _TIF_WORK_CTXSW \ | 175 | #define _TIF_WORK_CTXSW \ |
174 | (_TIF_IO_BITMAP | _TIF_NOTSC | _TIF_DEBUGCTLMSR | \ | 176 | (_TIF_IO_BITMAP | _TIF_NOTSC | _TIF_DEBUGCTLMSR | \ |
175 | _TIF_DS_AREA_MSR | _TIF_BTS_TRACE_TS) | 177 | _TIF_DS_AREA_MSR | _TIF_BTS_TRACE_TS) |
176 | #define _TIF_WORK_CTXSW_PREV _TIF_WORK_CTXSW | 178 | #define _TIF_WORK_CTXSW_PREV _TIF_WORK_CTXSW |
177 | #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW | _TIF_DEBUG) | 179 | #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW | _TIF_DEBUG) |
178 | 180 | ||
@@ -184,8 +186,10 @@ static inline struct thread_info *current_thread_info(void) | |||
184 | * ever touches our thread-synchronous status, so we don't | 186 | * ever touches our thread-synchronous status, so we don't |
185 | * have to worry about atomic accesses. | 187 | * have to worry about atomic accesses. |
186 | */ | 188 | */ |
187 | #define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ | 189 | #define TS_USEDFPU 0x0001 /* FPU was used by this task |
188 | #define TS_POLLING 0x0002 /* True if in idle loop and not sleeping */ | 190 | this quantum (SMP) */ |
191 | #define TS_POLLING 0x0002 /* True if in idle loop | ||
192 | and not sleeping */ | ||
189 | 193 | ||
190 | #define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING) | 194 | #define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING) |
191 | 195 | ||