Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319593
b: refs/heads/master
c: 914f848
h: refs/heads/master
i:
  319591: 1aa10cd
v: v3
  • Loading branch information
David Daney authored and Ralf Baechle committed Jul 23, 2012
1 parent 76b927f commit d40c79d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 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: 497e5ff03f58583ada469db8a1aa34eced9dd63e
refs/heads/master: 914f848077fb2ec0ec9c041af9ae1101ed0320f3
16 changes: 12 additions & 4 deletions trunk/arch/mips/cavium-octeon/octeon-memcpy.S
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@
.set noreorder
.set noat

/*
* t7 is used as a flag to note inatomic mode.
*/
LEAF(__copy_user_inatomic)
b __copy_user_common
li t7, 1
END(__copy_user_inatomic)

/*
* A combined memcpy/__copy_user
* __copy_user sets len to 0 for success; else to an upper bound of
Expand All @@ -174,6 +182,8 @@ LEAF(memcpy) /* a0=dst a1=src a2=len */
move v0, dst /* return value */
__memcpy:
FEXPORT(__copy_user)
li t7, 0 /* not inatomic */
__copy_user_common:
/*
* Note: dst & src may be unaligned, len may be 0
* Temps
Expand Down Expand Up @@ -412,7 +422,6 @@ l_exc_copy:
* Assumes src < THREAD_BUADDR($28)
*/
LOAD t0, TI_TASK($28)
nop
LOAD t0, THREAD_BUADDR(t0)
1:
EXC( lb t1, 0(src), l_exc)
Expand All @@ -422,10 +431,9 @@ EXC( lb t1, 0(src), l_exc)
ADD dst, dst, 1
l_exc:
LOAD t0, TI_TASK($28)
nop
LOAD t0, THREAD_BUADDR(t0) # t0 is just past last good address
nop
SUB len, AT, t0 # len number of uncopied bytes
bnez t7, 2f /* Skip the zeroing out part if inatomic */
/*
* Here's where we rely on src and dst being incremented in tandem,
* See (3) above.
Expand All @@ -443,7 +451,7 @@ l_exc:
ADD dst, dst, 1
bnez src, 1b
SUB src, src, 1
jr ra
2: jr ra
nop


Expand Down

0 comments on commit d40c79d

Please sign in to comment.