Skip to content

Commit

Permalink
sh: Check SR.DSP bit for DSP regset validity.
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Sep 12, 2008
1 parent f9540ec commit 7246199
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/sh/kernel/ptrace_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ static int dspregs_set(struct task_struct *target,

return ret;
}

static int dspregs_active(struct task_struct *target,
const struct user_regset *regset)
{
struct pt_regs *regs = task_pt_regs(target);

return regs->sr & SR_DSP ? regset->n : 0;
}
#endif

/*
Expand Down Expand Up @@ -213,6 +221,7 @@ static const struct user_regset sh_regsets[] = {
.align = sizeof(long),
.get = dspregs_get,
.set = dspregs_set,
.active = dspregs_active,
},
#endif
};
Expand Down

0 comments on commit 7246199

Please sign in to comment.