Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272050
b: refs/heads/master
c: a45aff5
h: refs/heads/master
v: v3
  • Loading branch information
Martin Schwidefsky committed Oct 30, 2011
1 parent 215c0cd commit d01abf3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 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: caa04f69df9a5d4c10867b475006cf6f2f1e8500
refs/heads/master: a45aff5285871bf7be1781d9462d3fdbb6c913f9
30 changes: 16 additions & 14 deletions trunk/arch/s390/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,31 @@ enum s390_regset {

void update_per_regs(struct task_struct *task)
{
static const struct per_regs per_single_step = {
.control = PER_EVENT_IFETCH,
.start = 0,
.end = PSW_ADDR_INSN,
};
struct pt_regs *regs = task_pt_regs(task);
struct thread_struct *thread = &task->thread;
const struct per_regs *new;
struct per_regs old;

/* TIF_SINGLE_STEP overrides the user specified PER registers. */
new = test_tsk_thread_flag(task, TIF_SINGLE_STEP) ?
&per_single_step : &thread->per_user;
struct per_regs old, new;

/* Copy user specified PER registers */
new.control = thread->per_user.control;
new.start = thread->per_user.start;
new.end = thread->per_user.end;

/* merge TIF_SINGLE_STEP into user specified PER registers. */
if (test_tsk_thread_flag(task, TIF_SINGLE_STEP)) {
new.control |= PER_EVENT_IFETCH;
new.start = 0;
new.end = PSW_ADDR_INSN;
}

/* Take care of the PER enablement bit in the PSW. */
if (!(new->control & PER_EVENT_MASK)) {
if (!(new.control & PER_EVENT_MASK)) {
regs->psw.mask &= ~PSW_MASK_PER;
return;
}
regs->psw.mask |= PSW_MASK_PER;
__ctl_store(old, 9, 11);
if (memcmp(new, &old, sizeof(struct per_regs)) != 0)
__ctl_load(*new, 9, 11);
if (memcmp(&new, &old, sizeof(struct per_regs)) != 0)
__ctl_load(new, 9, 11);
}

void user_enable_single_step(struct task_struct *task)
Expand Down

0 comments on commit d01abf3

Please sign in to comment.