aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/traps.c
diff options
context:
space:
mode:
authorVincent Hanquez <vincent.hanquez@cl.cam.ac.uk>2005-06-23 03:08:45 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-23 12:45:14 -0400
commit717b594a415bfaf2dbd5e8266636488f2564c689 (patch)
tree3d5e1f0a5321c172d35473509a06cf833c916d3a /arch/i386/kernel/traps.c
parentfa1e1bdf78d405f9905b8290ee9211e7a7bbc99b (diff)
[PATCH] xen: x86: Use more usermode macro
Use the user_mode macro where it's possible. Signed-off-by: Vincent Hanquez <vincent.hanquez@cl.cam.ac.uk> Cc: Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/traps.c')
-rw-r--r--arch/i386/kernel/traps.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index c01d7ba6d7e8..e4d4e2162c7a 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -210,7 +210,7 @@ void show_registers(struct pt_regs *regs)
210 210
211 esp = (unsigned long) (&regs->esp); 211 esp = (unsigned long) (&regs->esp);
212 ss = __KERNEL_DS; 212 ss = __KERNEL_DS;
213 if (regs->xcs & 3) { 213 if (user_mode(regs)) {
214 in_kernel = 0; 214 in_kernel = 0;
215 esp = regs->esp; 215 esp = regs->esp;
216 ss = regs->xss & 0xffff; 216 ss = regs->xss & 0xffff;
@@ -266,7 +266,7 @@ static void handle_BUG(struct pt_regs *regs)
266 char c; 266 char c;
267 unsigned long eip; 267 unsigned long eip;
268 268
269 if (regs->xcs & 3) 269 if (user_mode(regs))
270 goto no_bug; /* Not in kernel */ 270 goto no_bug; /* Not in kernel */
271 271
272 eip = regs->eip; 272 eip = regs->eip;
@@ -354,7 +354,7 @@ void die(const char * str, struct pt_regs * regs, long err)
354 354
355static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err) 355static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err)
356{ 356{
357 if (!(regs->eflags & VM_MASK) && !(3 & regs->xcs)) 357 if (!user_mode_vm(regs))
358 die(str, regs, err); 358 die(str, regs, err);
359} 359}
360 360
@@ -367,7 +367,7 @@ static void do_trap(int trapnr, int signr, char *str, int vm86,
367 goto trap_signal; 367 goto trap_signal;
368 } 368 }
369 369
370 if (!(regs->xcs & 3)) 370 if (!user_mode(regs))
371 goto kernel_trap; 371 goto kernel_trap;
372 372
373 trap_signal: { 373 trap_signal: {
@@ -489,7 +489,7 @@ fastcall void do_general_protection(struct pt_regs * regs, long error_code)
489 if (regs->eflags & VM_MASK) 489 if (regs->eflags & VM_MASK)
490 goto gp_in_vm86; 490 goto gp_in_vm86;
491 491
492 if (!(regs->xcs & 3)) 492 if (!user_mode(regs))
493 goto gp_in_kernel; 493 goto gp_in_kernel;
494 494
495 current->thread.error_code = error_code; 495 current->thread.error_code = error_code;
@@ -716,7 +716,7 @@ fastcall void do_debug(struct pt_regs * regs, long error_code)
716 * check for kernel mode by just checking the CPL 716 * check for kernel mode by just checking the CPL
717 * of CS. 717 * of CS.
718 */ 718 */
719 if ((regs->xcs & 3) == 0) 719 if (!user_mode(regs))
720 goto clear_TF_reenable; 720 goto clear_TF_reenable;
721 } 721 }
722 722