Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177296
b: refs/heads/master
c: 2f5a086
h: refs/heads/master
v: v3
  • Loading branch information
Mike Frysinger committed Dec 15, 2009
1 parent 4668f21 commit 673b8c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 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: 0d5e35940b3ec3a0695cfcd8f6273ba083638c22
refs/heads/master: 2f5a0864025743aeae20669984c1a998fe263194
18 changes: 11 additions & 7 deletions trunk/arch/blackfin/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,59 +258,63 @@ void finish_atomic_sections (struct pt_regs *regs)
int __user *up0 = (int __user *)regs->p0;

switch (regs->pc) {
default:
/* not in middle of an atomic step, so resume like normal */
return;

case ATOMIC_XCHG32 + 2:
put_user(regs->r1, up0);
regs->pc = ATOMIC_XCHG32 + 4;
break;

case ATOMIC_CAS32 + 2:
case ATOMIC_CAS32 + 4:
if (regs->r0 == regs->r1)
case ATOMIC_CAS32 + 6:
put_user(regs->r2, up0);
regs->pc = ATOMIC_CAS32 + 8;
break;

case ATOMIC_ADD32 + 2:
regs->r0 = regs->r1 + regs->r0;
/* fall through */
case ATOMIC_ADD32 + 4:
put_user(regs->r0, up0);
regs->pc = ATOMIC_ADD32 + 6;
break;

case ATOMIC_SUB32 + 2:
regs->r0 = regs->r1 - regs->r0;
/* fall through */
case ATOMIC_SUB32 + 4:
put_user(regs->r0, up0);
regs->pc = ATOMIC_SUB32 + 6;
break;

case ATOMIC_IOR32 + 2:
regs->r0 = regs->r1 | regs->r0;
/* fall through */
case ATOMIC_IOR32 + 4:
put_user(regs->r0, up0);
regs->pc = ATOMIC_IOR32 + 6;
break;

case ATOMIC_AND32 + 2:
regs->r0 = regs->r1 & regs->r0;
/* fall through */
case ATOMIC_AND32 + 4:
put_user(regs->r0, up0);
regs->pc = ATOMIC_AND32 + 6;
break;

case ATOMIC_XOR32 + 2:
regs->r0 = regs->r1 ^ regs->r0;
/* fall through */
case ATOMIC_XOR32 + 4:
put_user(regs->r0, up0);
regs->pc = ATOMIC_XOR32 + 6;
break;
}

/*
* We've finished the atomic section, and the only thing left for
* userspace is to do a RTS, so we might as well handle that too
* since we need to update the PC anyways.
*/
regs->pc = regs->rets;
}

static inline
Expand Down

0 comments on commit 673b8c0

Please sign in to comment.