git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git]
/
arch
/
s390
/
lib
/
uaccess.S
diff --git
a/arch/s390/lib/uaccess.S
b/arch/s390/lib/uaccess.S
index
e8029ef
..
3f5511d
100644
(file)
--- a/
arch/s390/lib/uaccess.S
+++ b/
arch/s390/lib/uaccess.S
@@
-11,7
+11,7
@@
#include <linux/errno.h>
#include <asm/lowcore.h>
#include <linux/errno.h>
#include <asm/lowcore.h>
-#include <asm/offsets.h>
+#include <asm/
asm-
offsets.h>
.text
.align 4
.text
.align 4
@@
-40,7
+40,17
@@
__copy_from_user_asm:
# move with the reduced length which is < 256
5: mvcp 0(%r5,%r2),0(%r4),%r0
slr %r3,%r5
# move with the reduced length which is < 256
5: mvcp 0(%r5,%r2),0(%r4),%r0
slr %r3,%r5
-6: lr %r2,%r3
+ alr %r2,%r5
+6: lgr %r5,%r3 # copy remaining size
+ ahi %r5,-1 # subtract 1 for xc loop
+ bras %r4,8f
+ xc 0(1,%2),0(%2)
+7: xc 0(256,%2),0(%2)
+ la %r2,256(%r2)
+8: ahji %r5,-256
+ jnm 7b
+ ex %r5,0(%r2)
+9: lr %r2,%r3
br %r14
.section __ex_table,"a"
.long 0b,4b
br %r14
.section __ex_table,"a"
.long 0b,4b
@@
-88,30
+98,31
@@
__copy_to_user_asm:
.globl __copy_in_user_asm
# %r2 = from, %r3 = n, %r4 = to
__copy_in_user_asm:
.globl __copy_in_user_asm
# %r2 = from, %r3 = n, %r4 = to
__copy_in_user_asm:
+ ahi %r3,-1
+ jo 6f
sacf 256
sacf 256
- bras 1,1f
- mvc 0(1,%r4),0(%r2)
-0: mvc 0(256,%r4),0(%r2)
- la %r2,256(%r2)
- la %r4,256(%r4)
-1: ahi %r3,-256
- jnm 0b
-2: ex %r3,0(%r1)
- sacf 0
- slr %r2,%r2
- br 14
-3: mvc 0(1,%r4),0(%r2)
+ bras %r1,4f
+0: ahi %r3,257
+1: mvc 0(1,%r4),0(%r2)
la %r2,1(%r2)
la %r4,1(%r4)
ahi %r3,-1
la %r2,1(%r2)
la %r4,1(%r4)
ahi %r3,-1
+ jnz 1b
+2: lr %r2,%r3
+ br %r14
+3: mvc 0(256,%r4),0(%r2)
+ la %r2,256(%r2)
+ la %r4,256(%r4)
+4: ahi %r3,-256
jnm 3b
jnm 3b
-4: lr %r2,%r3
+5: ex %r3,4(%r1)
sacf 0
sacf 0
+6: slr %r2,%r2
br %r14
.section __ex_table,"a"
br %r14
.section __ex_table,"a"
- .long
0b,3
b
- .long
2b,3
b
- .long
3b,4
b
+ .long
1b,2
b
+ .long
3b,0
b
+ .long
5b,0
b
.previous
.align 4
.previous
.align 4
@@
-198,12
+209,12
@@
__strnlen_user_asm:
0: srst %r2,%r1
jo 0b
sacf 0
0: srst %r2,%r1
jo 0b
sacf 0
- jh 1f # \0 found in string ?
ahi %r2,1 # strnlen_user result includes the \0
ahi %r2,1 # strnlen_user result includes the \0
-1: slr %r2,%r3
+ # or return count+1 if \0 not found
+ slr %r2,%r3
br %r14
2: sacf 0
br %r14
2: sacf 0
- lhi %r2,-EFAULT
+ slr %r2,%r2 # return 0 on exception
br %r14
.section __ex_table,"a"
.long 0b,2b
br %r14
.section __ex_table,"a"
.long 0b,2b