Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334673
b: refs/heads/master
c: 8f34a1d
h: refs/heads/master
i:
  334671: f36d822
v: v3
  • Loading branch information
Will Deacon authored and Catalin Marinas committed Oct 18, 2012
1 parent 81c771e commit 9613a2e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 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: 7797d17c591ae62c6f43c6de4fdb8beeb50eb692
refs/heads/master: 8f34a1da35aed7b438a2de8ac27723a5472e8399
37 changes: 21 additions & 16 deletions trunk/arch/arm64/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,28 +234,33 @@ static int ptrace_hbp_fill_attr_ctrl(unsigned int note_type,
struct arch_hw_breakpoint_ctrl ctrl,
struct perf_event_attr *attr)
{
int err, len, type;
int err, len, type, disabled = !ctrl.enabled;

err = arch_bp_generic_fields(ctrl, &len, &type);
if (err)
return err;

switch (note_type) {
case NT_ARM_HW_BREAK:
if ((type & HW_BREAKPOINT_X) != type)
return -EINVAL;
break;
case NT_ARM_HW_WATCH:
if ((type & HW_BREAKPOINT_RW) != type)
if (disabled) {
len = 0;
type = HW_BREAKPOINT_EMPTY;
} else {
err = arch_bp_generic_fields(ctrl, &len, &type);
if (err)
return err;

switch (note_type) {
case NT_ARM_HW_BREAK:
if ((type & HW_BREAKPOINT_X) != type)
return -EINVAL;
break;
case NT_ARM_HW_WATCH:
if ((type & HW_BREAKPOINT_RW) != type)
return -EINVAL;
break;
default:
return -EINVAL;
break;
default:
return -EINVAL;
}
}

attr->bp_len = len;
attr->bp_type = type;
attr->disabled = !ctrl.enabled;
attr->disabled = disabled;

return 0;
}
Expand Down

0 comments on commit 9613a2e

Please sign in to comment.