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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>

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);
__
Chuck
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux