|
@@ -57,14 +57,21 @@ struct pt_regs {
|
|
#ifdef __KERNEL__
|
|
#ifdef __KERNEL__
|
|
struct task_struct;
|
|
struct task_struct;
|
|
extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code);
|
|
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)
|
|
#define instruction_pointer(regs) ((regs)->eip)
|
|
#if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER)
|
|
#if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER)
|
|
extern unsigned long profile_pc(struct pt_regs *regs);
|
|
extern unsigned long profile_pc(struct pt_regs *regs);
|
|
#else
|
|
#else
|
|
#define profile_pc(regs) instruction_pointer(regs)
|
|
#define profile_pc(regs) instruction_pointer(regs)
|
|
#endif
|
|
#endif
|
|
-#endif
|
|
|
|
|
|
+#endif /* __KERNEL__ */
|
|
|
|
|
|
#endif
|
|
#endif
|