diff options
Diffstat (limited to 'include/asm-i386/ptrace.h')
-rw-r--r-- | include/asm-i386/ptrace.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/asm-i386/ptrace.h b/include/asm-i386/ptrace.h index 8618914b3521..05532875e39e 100644 --- a/include/asm-i386/ptrace.h +++ b/include/asm-i386/ptrace.h | |||
@@ -55,15 +55,26 @@ struct pt_regs { | |||
55 | #define PTRACE_SET_THREAD_AREA 26 | 55 | #define PTRACE_SET_THREAD_AREA 26 |
56 | 56 | ||
57 | #ifdef __KERNEL__ | 57 | #ifdef __KERNEL__ |
58 | |||
59 | #include <asm/vm86.h> | ||
60 | |||
58 | struct task_struct; | 61 | struct task_struct; |
59 | extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code); | 62 | extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code); |
60 | #define user_mode(regs) ((VM_MASK & (regs)->eflags) || (3 & (regs)->xcs)) | 63 | |
64 | static inline int user_mode(struct pt_regs *regs) | ||
65 | { | ||
66 | return (regs->xcs & 3) != 0; | ||
67 | } | ||
68 | static inline int user_mode_vm(struct pt_regs *regs) | ||
69 | { | ||
70 | return ((regs->xcs & 3) | (regs->eflags & VM_MASK)) != 0; | ||
71 | } | ||
61 | #define instruction_pointer(regs) ((regs)->eip) | 72 | #define instruction_pointer(regs) ((regs)->eip) |
62 | #if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER) | 73 | #if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER) |
63 | extern unsigned long profile_pc(struct pt_regs *regs); | 74 | extern unsigned long profile_pc(struct pt_regs *regs); |
64 | #else | 75 | #else |
65 | #define profile_pc(regs) instruction_pointer(regs) | 76 | #define profile_pc(regs) instruction_pointer(regs) |
66 | #endif | 77 | #endif |
67 | #endif | 78 | #endif /* __KERNEL__ */ |
68 | 79 | ||
69 | #endif | 80 | #endif |