diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-04-28 21:52:35 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-05-12 15:28:03 -0400 |
commit | 006c484bb3d9547e82a33a09668c9b54b912c8fb (patch) | |
tree | 8cf69d55b1582ef90df1fb2f533d2f2f8e4a9c80 | |
parent | f2ea3b1d4d7ab66d86da57899993282f3deb1f74 (diff) |
x86: common thread_info definitions
Merge the thread_info definition into one structure definition for both arches.
The __u32 is equal to unsigned long for 32 bit.
sysenter_return is used both for the IA32 emulation for 64 and x86_32.
Avoid complicated #ifdef by simply always including it.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | include/asm-x86/thread_info.h | 55 |
1 files changed, 12 insertions, 43 deletions
diff --git a/include/asm-x86/thread_info.h b/include/asm-x86/thread_info.h index 4b91f59de8fc..71b0880d80b5 100644 --- a/include/asm-x86/thread_info.h +++ b/include/asm-x86/thread_info.h | |||
@@ -11,47 +11,42 @@ | |||
11 | #include <asm/page.h> | 11 | #include <asm/page.h> |
12 | #include <asm/types.h> | 12 | #include <asm/types.h> |
13 | 13 | ||
14 | #ifdef CONFIG_X86_32 | ||
15 | |||
16 | #ifndef __ASSEMBLY__ | ||
17 | #include <asm/processor.h> | ||
18 | #endif | ||
19 | |||
20 | /* | 14 | /* |
21 | * low level task data that entry.S needs immediate access to | 15 | * low level task data that entry.S needs immediate access to |
22 | * - this struct should fit entirely inside of one cache line | 16 | * - this struct should fit entirely inside of one cache line |
23 | * - this struct shares the supervisor stack pages | 17 | * - this struct shares the supervisor stack pages |
24 | * - if the contents of this structure are changed, | ||
25 | * the assembly constants must also be changed | ||
26 | */ | 18 | */ |
27 | #ifndef __ASSEMBLY__ | 19 | #ifndef __ASSEMBLY__ |
20 | struct task_struct; | ||
21 | struct exec_domain; | ||
22 | #include <asm/processor.h> | ||
28 | 23 | ||
29 | struct thread_info { | 24 | struct thread_info { |
30 | struct task_struct *task; /* main task structure */ | 25 | struct task_struct *task; /* main task structure */ |
31 | struct exec_domain *exec_domain; /* execution domain */ | 26 | struct exec_domain *exec_domain; /* execution domain */ |
32 | unsigned long flags; /* low level flags */ | 27 | __u32 flags; /* low level flags */ |
33 | unsigned long status; /* thread-synchronous flags */ | 28 | __u32 status; /* thread synchronous flags */ |
34 | __u32 cpu; /* current CPU */ | 29 | __u32 cpu; /* current CPU */ |
35 | int preempt_count; /* 0 => preemptable, | 30 | int preempt_count; /* 0 => preemptable, |
36 | <0 => BUG */ | 31 | <0 => BUG */ |
37 | mm_segment_t addr_limit; /* thread address space: | 32 | mm_segment_t addr_limit; |
38 | 0-0xBFFFFFFF user-thread | ||
39 | 0-0xFFFFFFFF kernel-thread | ||
40 | */ | ||
41 | void *sysenter_return; | ||
42 | struct restart_block restart_block; | 33 | struct restart_block restart_block; |
34 | void __user *sysenter_return; | ||
35 | #ifdef CONFIG_X86_32 | ||
43 | unsigned long previous_esp; /* ESP of the previous stack in | 36 | unsigned long previous_esp; /* ESP of the previous stack in |
44 | case of nested (IRQ) stacks | 37 | case of nested (IRQ) stacks |
45 | */ | 38 | */ |
46 | __u8 supervisor_stack[0]; | 39 | __u8 supervisor_stack[0]; |
40 | #endif | ||
47 | }; | 41 | }; |
48 | |||
49 | #else /* !__ASSEMBLY__ */ | 42 | #else /* !__ASSEMBLY__ */ |
50 | 43 | ||
51 | #include <asm/asm-offsets.h> | 44 | #include <asm/asm-offsets.h> |
52 | 45 | ||
53 | #endif | 46 | #endif |
54 | 47 | ||
48 | #ifdef CONFIG_X86_32 | ||
49 | |||
55 | #define PREEMPT_ACTIVE 0x10000000 | 50 | #define PREEMPT_ACTIVE 0x10000000 |
56 | #ifdef CONFIG_4KSTACKS | 51 | #ifdef CONFIG_4KSTACKS |
57 | #define THREAD_SIZE (4096) | 52 | #define THREAD_SIZE (4096) |
@@ -182,32 +177,6 @@ static inline struct thread_info *current_thread_info(void) | |||
182 | #include <asm/pda.h> | 177 | #include <asm/pda.h> |
183 | 178 | ||
184 | /* | 179 | /* |
185 | * low level task data that entry.S needs immediate access to | ||
186 | * - this struct should fit entirely inside of one cache line | ||
187 | * - this struct shares the supervisor stack pages | ||
188 | */ | ||
189 | #ifndef __ASSEMBLY__ | ||
190 | struct task_struct; | ||
191 | struct exec_domain; | ||
192 | #include <asm/processor.h> | ||
193 | |||
194 | struct thread_info { | ||
195 | struct task_struct *task; /* main task structure */ | ||
196 | struct exec_domain *exec_domain; /* execution domain */ | ||
197 | __u32 flags; /* low level flags */ | ||
198 | __u32 status; /* thread synchronous flags */ | ||
199 | __u32 cpu; /* current CPU */ | ||
200 | int preempt_count; /* 0 => preemptable, | ||
201 | <0 => BUG */ | ||
202 | mm_segment_t addr_limit; | ||
203 | struct restart_block restart_block; | ||
204 | #ifdef CONFIG_IA32_EMULATION | ||
205 | void __user *sysenter_return; | ||
206 | #endif | ||
207 | }; | ||
208 | #endif | ||
209 | |||
210 | /* | ||
211 | * macros/functions for gaining access to the thread information structure | 180 | * macros/functions for gaining access to the thread information structure |
212 | * preempt_count needs to be 1 initially, until the scheduler is functional. | 181 | * preempt_count needs to be 1 initially, until the scheduler is functional. |
213 | */ | 182 | */ |