Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188505
b: refs/heads/master
c: 5f09c77
h: refs/heads/master
i:
  188503: f50f782
v: v3
  • Loading branch information
Mike Frysinger committed Mar 9, 2010
1 parent 35253df commit 9e0eaf3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 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: f5b99627a3065858ad5c678703ed7af5363dca39
refs/heads/master: 5f09c77d2ad69397498b6555f0d3cd697304253c
24 changes: 6 additions & 18 deletions trunk/arch/blackfin/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
* in exit.c or in signal.c.
*/

/* determines which bits in the SYSCFG reg the user has access to. */
/* 1 = access 0 = no access */
#define SYSCFG_MASK 0x0007 /* SYSCFG reg */
/* sets the trace bits. */
#define TRACE_BITS 0x0001

/* Find the stack offset for a register, relative to thread.esp0. */
#define PT_REG(reg) ((long)&((struct pt_regs *)0)->reg)

Expand Down Expand Up @@ -162,9 +156,8 @@ static inline int is_user_addr_valid(struct task_struct *child,

void ptrace_enable(struct task_struct *child)
{
unsigned long tmp;
tmp = get_reg(child, PT_SYSCFG) | (TRACE_BITS);
put_reg(child, PT_SYSCFG, tmp);
struct pt_regs *regs = task_pt_regs(child);
regs->syscfg |= SYSCFG_SSSTEP;
}

/*
Expand All @@ -174,10 +167,8 @@ void ptrace_enable(struct task_struct *child)
*/
void ptrace_disable(struct task_struct *child)
{
unsigned long tmp;
/* make sure the single step bit is not set. */
tmp = get_reg(child, PT_SYSCFG) & ~TRACE_BITS;
put_reg(child, PT_SYSCFG, tmp);
struct pt_regs *regs = task_pt_regs(child);
regs->syscfg &= ~SYSCFG_SSSTEP;
}

long arch_ptrace(struct task_struct *child, long request, long addr, long data)
Expand Down Expand Up @@ -343,14 +334,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
break;
}

if (addr >= (sizeof(struct pt_regs))) {
/* Ignore writes to SYSCFG and other pseudo regs */
if (addr >= PT_SYSCFG) {
ret = 0;
break;
}
if (addr == PT_SYSCFG) {
data &= SYSCFG_MASK;
data |= get_reg(child, PT_SYSCFG);
}
ret = put_reg(child, addr, data);
break;

Expand Down

0 comments on commit 9e0eaf3

Please sign in to comment.