[PATCH] i386: clean up user_mode macros

- make the new user_mode() return 0 or 1 (same as x86_64)

- remove conditional jump from user_mode_vm() it's called every timer
tick on each CPU on SMP)

Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Chuck Ebbert and committed by Linus Torvalds ae6578fe 4d7de66e

+10 -3
+10 -3
include/asm-i386/ptrace.h
··· 57 #ifdef __KERNEL__ 58 struct task_struct; 59 extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code); 60 - #define user_mode(regs) (3 & (regs)->xcs) 61 - #define user_mode_vm(regs) ((VM_MASK & (regs)->eflags) || user_mode(regs)) 62 #define instruction_pointer(regs) ((regs)->eip) 63 #if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER) 64 extern unsigned long profile_pc(struct pt_regs *regs); 65 #else 66 #define profile_pc(regs) instruction_pointer(regs) 67 #endif 68 - #endif 69 70 #endif
··· 57 #ifdef __KERNEL__ 58 struct task_struct; 59 extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code); 60 + 61 + static inline int user_mode(struct pt_regs *regs) 62 + { 63 + return (regs->xcs & 3) != 0; 64 + } 65 + static inline int user_mode_vm(struct pt_regs *regs) 66 + { 67 + return ((regs->xcs & 3) | (regs->eflags & VM_MASK)) != 0; 68 + } 69 #define instruction_pointer(regs) ((regs)->eip) 70 #if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER) 71 extern unsigned long profile_pc(struct pt_regs *regs); 72 #else 73 #define profile_pc(regs) instruction_pointer(regs) 74 #endif 75 + #endif /* __KERNEL__ */ 76 77 #endif