diff options
Diffstat (limited to 'arch/x86/include/asm/system.h')
-rw-r--r-- | arch/x86/include/asm/system.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h index 70c74b8db875..79b98e5b96f4 100644 --- a/arch/x86/include/asm/system.h +++ b/arch/x86/include/asm/system.h | |||
@@ -186,10 +186,20 @@ extern void native_load_gs_index(unsigned); | |||
186 | * x86_32 user gs accessors. | 186 | * x86_32 user gs accessors. |
187 | */ | 187 | */ |
188 | #ifdef CONFIG_X86_32 | 188 | #ifdef CONFIG_X86_32 |
189 | #ifdef CONFIG_X86_32_LAZY_GS | ||
189 | #define get_user_gs(regs) (u16)({unsigned long v; savesegment(gs, v); v;}) | 190 | #define get_user_gs(regs) (u16)({unsigned long v; savesegment(gs, v); v;}) |
190 | #define set_user_gs(regs, v) loadsegment(gs, (unsigned long)(v)) | 191 | #define set_user_gs(regs, v) loadsegment(gs, (unsigned long)(v)) |
191 | #define task_user_gs(tsk) ((tsk)->thread.gs) | 192 | #define task_user_gs(tsk) ((tsk)->thread.gs) |
192 | #endif | 193 | #define lazy_save_gs(v) savesegment(gs, (v)) |
194 | #define lazy_load_gs(v) loadsegment(gs, (v)) | ||
195 | #else /* X86_32_LAZY_GS */ | ||
196 | #define get_user_gs(regs) (u16)((regs)->gs) | ||
197 | #define set_user_gs(regs, v) do { (regs)->gs = (v); } while (0) | ||
198 | #define task_user_gs(tsk) (task_pt_regs(tsk)->gs) | ||
199 | #define lazy_save_gs(v) do { } while (0) | ||
200 | #define lazy_load_gs(v) do { } while (0) | ||
201 | #endif /* X86_32_LAZY_GS */ | ||
202 | #endif /* X86_32 */ | ||
193 | 203 | ||
194 | static inline unsigned long get_limit(unsigned long segment) | 204 | static inline unsigned long get_limit(unsigned long segment) |
195 | { | 205 | { |