Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79866
b: refs/heads/master
c: 77c03dc
h: refs/heads/master
v: v3
  • Loading branch information
Roland McGrath authored and Ingo Molnar committed Jan 30, 2008
1 parent aed5f7c commit 194cf78
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2608a6584a0a32d3251dfafad31d9f8b2c784466
refs/heads/master: 77c03dcd448aa4c7be45f4edb97381ef463e3911
9 changes: 3 additions & 6 deletions trunk/arch/x86/kernel/ptrace_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
*/
#define FLAG_MASK 0x00050dd5

/* set's the trap flag. */
#define TRAP_FLAG 0x100

/*
* Offset of eflags on child stack..
*/
Expand Down Expand Up @@ -235,11 +232,11 @@ static void set_singlestep(struct task_struct *child)
/*
* If TF was already set, don't do anything else
*/
if (regs->eflags & TRAP_FLAG)
if (regs->eflags & X86_EFLAGS_TF)
return;

/* Set TF on the kernel stack.. */
regs->eflags |= TRAP_FLAG;
regs->eflags |= X86_EFLAGS_TF;

/*
* ..but if TF is changed by the instruction we will trace,
Expand All @@ -260,7 +257,7 @@ static void clear_singlestep(struct task_struct *child)
/* But touch TF only if it was set by us.. */
if (child->ptrace & PT_DTRACE) {
struct pt_regs *regs = get_child_regs(child);
regs->eflags &= ~TRAP_FLAG;
regs->eflags &= ~X86_EFLAGS_TF;
child->ptrace &= ~PT_DTRACE;
}
}
Expand Down
9 changes: 3 additions & 6 deletions trunk/arch/x86/kernel/ptrace_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
*/
#define FLAG_MASK 0x54dd5UL

/* set's the trap flag. */
#define TRAP_FLAG 0x100UL

/*
* eflags and offset of eflags on child stack..
*/
Expand Down Expand Up @@ -187,11 +184,11 @@ static void set_singlestep(struct task_struct *child)
/*
* If TF was already set, don't do anything else
*/
if (regs->eflags & TRAP_FLAG)
if (regs->eflags & X86_EFLAGS_TF)
return;

/* Set TF on the kernel stack.. */
regs->eflags |= TRAP_FLAG;
regs->eflags |= X86_EFLAGS_TF;

/*
* ..but if TF is changed by the instruction we will trace,
Expand All @@ -212,7 +209,7 @@ static void clear_singlestep(struct task_struct *child)
/* But touch TF only if it was set by us.. */
if (child->ptrace & PT_DTRACE) {
struct pt_regs *regs = task_pt_regs(child);
regs->eflags &= ~TRAP_FLAG;
regs->eflags &= ~X86_EFLAGS_TF;
child->ptrace &= ~PT_DTRACE;
}
}
Expand Down

0 comments on commit 194cf78

Please sign in to comment.