diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-30 07:31:31 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:31 -0500 |
commit | cb38d377337cadd73fe4c582f77c5273685aeb71 (patch) | |
tree | 79dfc538f91cc3695437177691ddfebd9f377708 | |
parent | 7818a1e0294debee02d5135e17b89f28b8871887 (diff) |
x86: unify thread struct.
The thread_struct is not fundamentally different between architectures, and
this patch puts it in the common header. What's really unique for each of
them is enclosed in ifdefs.
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | include/asm-x86/processor.h | 44 | ||||
-rw-r--r-- | include/asm-x86/processor_32.h | 37 | ||||
-rw-r--r-- | include/asm-x86/processor_64.h | 32 |
3 files changed, 44 insertions, 69 deletions
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h index b1ea52156362..0e82ad5a22a4 100644 --- a/include/asm-x86/processor.h +++ b/include/asm-x86/processor.h | |||
@@ -126,6 +126,50 @@ extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); | |||
126 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); | 126 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); |
127 | extern unsigned short num_cache_leaves; | 127 | extern unsigned short num_cache_leaves; |
128 | 128 | ||
129 | struct thread_struct { | ||
130 | /* cached TLS descriptors. */ | ||
131 | struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; | ||
132 | unsigned long sp0; | ||
133 | unsigned long sp; | ||
134 | #ifdef CONFIG_X86_32 | ||
135 | unsigned long sysenter_cs; | ||
136 | #else | ||
137 | unsigned long usersp; /* Copy from PDA */ | ||
138 | unsigned short es, ds, fsindex, gsindex; | ||
139 | #endif | ||
140 | unsigned long ip; | ||
141 | unsigned long fs; | ||
142 | unsigned long gs; | ||
143 | /* Hardware debugging registers */ | ||
144 | unsigned long debugreg0; | ||
145 | unsigned long debugreg1; | ||
146 | unsigned long debugreg2; | ||
147 | unsigned long debugreg3; | ||
148 | unsigned long debugreg6; | ||
149 | unsigned long debugreg7; | ||
150 | /* fault info */ | ||
151 | unsigned long cr2, trap_no, error_code; | ||
152 | /* floating point info */ | ||
153 | union i387_union i387 __attribute__((aligned(16)));; | ||
154 | #ifdef CONFIG_X86_32 | ||
155 | /* virtual 86 mode info */ | ||
156 | struct vm86_struct __user *vm86_info; | ||
157 | unsigned long screen_bitmap; | ||
158 | unsigned long v86flags, v86mask, saved_sp0; | ||
159 | unsigned int saved_fs, saved_gs; | ||
160 | #endif | ||
161 | /* IO permissions */ | ||
162 | unsigned long *io_bitmap_ptr; | ||
163 | unsigned long iopl; | ||
164 | /* max allowed port in the bitmap, in bytes: */ | ||
165 | unsigned io_bitmap_max; | ||
166 | /* MSR_IA32_DEBUGCTLMSR value to switch in if TIF_DEBUGCTLMSR is set. */ | ||
167 | unsigned long debugctlmsr; | ||
168 | /* Debug Store - if not 0 points to a DS Save Area configuration; | ||
169 | * goes into MSR_IA32_DS_AREA */ | ||
170 | unsigned long ds_area_msr; | ||
171 | }; | ||
172 | |||
129 | static inline unsigned long native_get_debugreg(int regno) | 173 | static inline unsigned long native_get_debugreg(int regno) |
130 | { | 174 | { |
131 | unsigned long val = 0; /* Damn you, gcc! */ | 175 | unsigned long val = 0; /* Damn you, gcc! */ |
diff --git a/include/asm-x86/processor_32.h b/include/asm-x86/processor_32.h index 53037d1a6ae6..8cb05cec3cb9 100644 --- a/include/asm-x86/processor_32.h +++ b/include/asm-x86/processor_32.h | |||
@@ -176,43 +176,6 @@ typedef struct { | |||
176 | 176 | ||
177 | #define ARCH_MIN_TASKALIGN 16 | 177 | #define ARCH_MIN_TASKALIGN 16 |
178 | 178 | ||
179 | struct thread_struct { | ||
180 | /* cached TLS descriptors. */ | ||
181 | struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; | ||
182 | unsigned long sp0; | ||
183 | unsigned long sysenter_cs; | ||
184 | unsigned long ip; | ||
185 | unsigned long sp; | ||
186 | unsigned long fs; | ||
187 | unsigned long gs; | ||
188 | /* Hardware debugging registers */ | ||
189 | unsigned long debugreg0; | ||
190 | unsigned long debugreg1; | ||
191 | unsigned long debugreg2; | ||
192 | unsigned long debugreg3; | ||
193 | unsigned long debugreg6; | ||
194 | unsigned long debugreg7; | ||
195 | /* fault info */ | ||
196 | unsigned long cr2, trap_no, error_code; | ||
197 | /* floating point info */ | ||
198 | union i387_union i387; | ||
199 | /* virtual 86 mode info */ | ||
200 | struct vm86_struct __user * vm86_info; | ||
201 | unsigned long screen_bitmap; | ||
202 | unsigned long v86flags, v86mask, saved_sp0; | ||
203 | unsigned int saved_fs, saved_gs; | ||
204 | /* IO permissions */ | ||
205 | unsigned long *io_bitmap_ptr; | ||
206 | unsigned long iopl; | ||
207 | /* max allowed port in the bitmap, in bytes: */ | ||
208 | unsigned long io_bitmap_max; | ||
209 | /* MSR_IA32_DEBUGCTLMSR value to switch in if TIF_DEBUGCTLMSR is set. */ | ||
210 | unsigned long debugctlmsr; | ||
211 | /* Debug Store - if not 0 points to a DS Save Area configuration; | ||
212 | * goes into MSR_IA32_DS_AREA */ | ||
213 | unsigned long ds_area_msr; | ||
214 | }; | ||
215 | |||
216 | #define INIT_THREAD { \ | 179 | #define INIT_THREAD { \ |
217 | .sp0 = sizeof(init_stack) + (long)&init_stack, \ | 180 | .sp0 = sizeof(init_stack) + (long)&init_stack, \ |
218 | .vm86_info = NULL, \ | 181 | .vm86_info = NULL, \ |
diff --git a/include/asm-x86/processor_64.h b/include/asm-x86/processor_64.h index 8d342c23ad14..4b4ec3d79910 100644 --- a/include/asm-x86/processor_64.h +++ b/include/asm-x86/processor_64.h | |||
@@ -125,38 +125,6 @@ DECLARE_PER_CPU(struct orig_ist, orig_ist); | |||
125 | #define ARCH_MIN_MMSTRUCT_ALIGN 0 | 125 | #define ARCH_MIN_MMSTRUCT_ALIGN 0 |
126 | #endif | 126 | #endif |
127 | 127 | ||
128 | struct thread_struct { | ||
129 | unsigned long sp0; | ||
130 | unsigned long sp; | ||
131 | unsigned long usersp; /* Copy from PDA */ | ||
132 | unsigned long fs; | ||
133 | unsigned long gs; | ||
134 | unsigned short es, ds, fsindex, gsindex; | ||
135 | /* Hardware debugging registers */ | ||
136 | unsigned long debugreg0; | ||
137 | unsigned long debugreg1; | ||
138 | unsigned long debugreg2; | ||
139 | unsigned long debugreg3; | ||
140 | unsigned long debugreg6; | ||
141 | unsigned long debugreg7; | ||
142 | /* fault info */ | ||
143 | unsigned long cr2, trap_no, error_code; | ||
144 | /* floating point info */ | ||
145 | union i387_union i387 __attribute__((aligned(16))); | ||
146 | /* IO permissions. the bitmap could be moved into the GDT, that would make | ||
147 | switch faster for a limited number of ioperm using tasks. -AK */ | ||
148 | int ioperm; | ||
149 | unsigned long *io_bitmap_ptr; | ||
150 | unsigned io_bitmap_max; | ||
151 | /* MSR_IA32_DEBUGCTLMSR value to switch in if TIF_DEBUGCTLMSR is set. */ | ||
152 | unsigned long debugctlmsr; | ||
153 | /* Debug Store - if not 0 points to a DS Save Area configuration; | ||
154 | * goes into MSR_IA32_DS_AREA */ | ||
155 | unsigned long ds_area_msr; | ||
156 | /* cached TLS descriptors. */ | ||
157 | struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; | ||
158 | } __attribute__((aligned(16))); | ||
159 | |||
160 | #define INIT_THREAD { \ | 128 | #define INIT_THREAD { \ |
161 | .sp0 = (unsigned long)&init_stack + sizeof(init_stack) \ | 129 | .sp0 = (unsigned long)&init_stack + sizeof(init_stack) \ |
162 | } | 130 | } |