[patch 2.6.13-rc3] i386: clean up user_mode macros

From: Chuck Ebbert
Date: Mon Jul 25 2005 - 18:06:22 EST

Recent patches from the Xen group changed the X86 user_mode macros.

This patch does the following:

1. Makes the new user_mode() return 0 or 1 (same as x86_64)

2. Removes conditional jump from user_mode_vm()
(it's called every timer tick on each CPU on SMP)

I've been running this patch for a while now. Please apply.

Signed-off-by: Chuck Ebbert <76306.1226@xxxxxxxxxxxxxx>

Index: 2.6.13-rc3a/include/asm-i386/ptrace.h
--- 2.6.13-rc3a.orig/include/asm-i386/ptrace.h 2005-07-13 16:20:26.000000000 -0400
+++ 2.6.13-rc3a/include/asm-i386/ptrace.h 2005-07-14 02:47:51.000000000 -0400
@@ -57,8 +57,8 @@
#ifdef __KERNEL__
struct task_struct;
extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code);
-#define user_mode(regs) (3 & (regs)->xcs)
-#define user_mode_vm(regs) ((VM_MASK & (regs)->eflags) || user_mode(regs))
+#define user_mode(regs) (!!(3 & (regs)->xcs))
+#define user_mode_vm(regs) (!!((VM_MASK & (regs)->eflags) | (3 & (regs)->xcs)))
#define instruction_pointer(regs) ((regs)->eip)
#if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER)
extern unsigned long profile_pc(struct pt_regs *regs);
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/