aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
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
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')
-rw-r--r--arch/i386/kernel/process.c2
-rw-r--r--arch/i386/kernel/signal.c2
-rw-r--r--arch/i386/kernel/traps.c12
3 files changed, 8 insertions, 8 deletions
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index 2468ab70c386..be3efba7caf7 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -266,7 +266,7 @@ void show_regs(struct pt_regs * regs)
266 printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id()); 266 printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id());
267 print_symbol("EIP is at %s\n", regs->eip); 267 print_symbol("EIP is at %s\n", regs->eip);
268 268
269 if (regs->xcs & 3) 269 if (user_mode(regs))
270 printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp); 270 printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp);
271 printk(" EFLAGS: %08lx %s (%s)\n", 271 printk(" EFLAGS: %08lx %s (%s)\n",
272 regs->eflags, print_tainted(), system_utsname.release); 272 regs->eflags, print_tainted(), system_utsname.release);
diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c
index 839d4dc88cd4..b9b8f4e20fad 100644
--- a/arch/i386/kernel/signal.c
+++ b/arch/i386/kernel/signal.c
@@ -605,7 +605,7 @@ int fastcall do_signal(struct pt_regs *regs, sigset_t *oldset)
605 * kernel mode. Just return without doing anything 605 * kernel mode. Just return without doing anything
606 * if so. 606 * if so.
607 */ 607 */
608 if ((regs->xcs & 3) != 3) 608 if (!user_mode(regs))
609 return 1; 609 return 1;
610 610
611 if (current->flags & PF_FREEZE) { 611 if (current->flags & PF_FREEZE) {
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