diff options
Diffstat (limited to 'include/asm-i386/ptrace.h')
-rw-r--r-- | include/asm-i386/ptrace.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/asm-i386/ptrace.h b/include/asm-i386/ptrace.h index 30a442ec2059..21bb91679c82 100644 --- a/include/asm-i386/ptrace.h +++ b/include/asm-i386/ptrace.h | |||
@@ -60,6 +60,7 @@ struct pt_regs { | |||
60 | #ifdef __KERNEL__ | 60 | #ifdef __KERNEL__ |
61 | 61 | ||
62 | #include <asm/vm86.h> | 62 | #include <asm/vm86.h> |
63 | #include <asm/segment.h> | ||
63 | 64 | ||
64 | struct task_struct; | 65 | struct task_struct; |
65 | extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code); | 66 | extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code); |
@@ -73,11 +74,11 @@ extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int erro | |||
73 | */ | 74 | */ |
74 | static inline int user_mode(struct pt_regs *regs) | 75 | static inline int user_mode(struct pt_regs *regs) |
75 | { | 76 | { |
76 | return (regs->xcs & 3) != 0; | 77 | return (regs->xcs & SEGMENT_RPL_MASK) == USER_RPL; |
77 | } | 78 | } |
78 | static inline int user_mode_vm(struct pt_regs *regs) | 79 | static inline int user_mode_vm(struct pt_regs *regs) |
79 | { | 80 | { |
80 | return ((regs->xcs & 3) | (regs->eflags & VM_MASK)) != 0; | 81 | return ((regs->xcs & SEGMENT_RPL_MASK) | (regs->eflags & VM_MASK)) >= USER_RPL; |
81 | } | 82 | } |
82 | #define instruction_pointer(regs) ((regs)->eip) | 83 | #define instruction_pointer(regs) ((regs)->eip) |
83 | extern unsigned long profile_pc(struct pt_regs *regs); | 84 | extern unsigned long profile_pc(struct pt_regs *regs); |