summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChuck Ebbert <76306.1226@compuserve.com>2005-07-26 21:57:24 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-26 19:25:01 -0700
commitae6578fe9b65208dee8eda40629984efd23740c4 (patch)
tree6b3c5fdb78864ef276e0d6bb4bb1eeecfe17587d /include
parent4d7de66e2cc508761f050d1d4eaca88a6e6f711e (diff)
downloadlinux-3.10-ae6578fe9b65208dee8eda40629984efd23740c4.tar.gz
linux-3.10-ae6578fe9b65208dee8eda40629984efd23740c4.tar.bz2
linux-3.10-ae6578fe9b65208dee8eda40629984efd23740c4.zip
[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>
Diffstat (limited to 'include')
-rw-r--r--include/asm-i386/ptrace.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/asm-i386/ptrace.h b/include/asm-i386/ptrace.h
index eef9f93870d..b926cb4f4cf 100644
--- a/include/asm-i386/ptrace.h
+++ b/include/asm-i386/ptrace.h
@@ -57,14 +57,21 @@ struct pt_regs {
#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))
+
+static inline int user_mode(struct pt_regs *regs)
+{
+ return (regs->xcs & 3) != 0;
+}
+static inline int user_mode_vm(struct pt_regs *regs)
+{
+ return ((regs->xcs & 3) | (regs->eflags & VM_MASK)) != 0;
+}
#define instruction_pointer(regs) ((regs)->eip)
#if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER)
extern unsigned long profile_pc(struct pt_regs *regs);
#else
#define profile_pc(regs) instruction_pointer(regs)
#endif
-#endif
+#endif /* __KERNEL__ */
#endif