diff options
author | Michal Simek <monstr@monstr.eu> | 2010-03-22 15:31:26 -0400 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2010-04-01 02:38:25 -0400 |
commit | ca3865bae5ff86f5670edc9beebbd1f58c29de85 (patch) | |
tree | 78aa70b8baec6a877c18ff2cdf7b018582157c21 /arch | |
parent | 6059b3cbeb27a38e3ca9ac9d2827f7b5be32e2ba (diff) |
microblaze: Support word copying in copy_tofrom_user
Word copying is used only for aligned addresses.
Here is space for improving to use any better copying technique.
Look at memcpy implementation.
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/microblaze/lib/uaccess_old.S | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/arch/microblaze/lib/uaccess_old.S b/arch/microblaze/lib/uaccess_old.S index b327524a8032..5810cec54a7a 100644 --- a/arch/microblaze/lib/uaccess_old.S +++ b/arch/microblaze/lib/uaccess_old.S | |||
@@ -53,7 +53,6 @@ __strncpy_user: | |||
53 | nop | 53 | nop |
54 | .size __strncpy_user, . - __strncpy_user | 54 | .size __strncpy_user, . - __strncpy_user |
55 | 55 | ||
56 | |||
57 | .section .fixup, "ax" | 56 | .section .fixup, "ax" |
58 | .align 2 | 57 | .align 2 |
59 | 4: | 58 | 4: |
@@ -95,7 +94,6 @@ __strnlen_user: | |||
95 | nop | 94 | nop |
96 | .size __strnlen_user, . - __strnlen_user | 95 | .size __strnlen_user, . - __strnlen_user |
97 | 96 | ||
98 | |||
99 | .section .fixup,"ax" | 97 | .section .fixup,"ax" |
100 | 4: | 98 | 4: |
101 | brid 3b | 99 | brid 3b |
@@ -121,21 +119,34 @@ __copy_tofrom_user: | |||
121 | * r7, r3 - count | 119 | * r7, r3 - count |
122 | * r4 - tempval | 120 | * r4 - tempval |
123 | */ | 121 | */ |
124 | addik r3,r7,0 | 122 | beqid r7, 3f /* zero size is not likely */ |
125 | beqi r3,3f | 123 | andi r3, r7, 0x3 /* filter add count */ |
126 | 1: | 124 | bneid r3, 4f /* if is odd value then byte copying */ |
127 | lbu r4,r6,r0 | 125 | or r3, r5, r6 /* find if is any to/from unaligned */ |
128 | addik r6,r6,1 | 126 | andi r3, r3, 0x3 /* mask unaligned */ |
129 | 2: | 127 | bneid r3, 1f /* it is unaligned -> then jump */ |
130 | sb r4,r5,r0 | 128 | or r3, r0, r0 |
131 | addik r3,r3,-1 | 129 | |
132 | bneid r3,1b | 130 | /* at least one 4 byte copy */ |
133 | addik r5,r5,1 /* delay slot */ | 131 | 5: lw r4, r6, r3 |
132 | 6: sw r4, r5, r3 | ||
133 | addik r7, r7, -4 | ||
134 | bneid r7, 5b | ||
135 | addik r3, r3, 4 | ||
136 | addik r3, r7, 0 | ||
137 | rtsd r15, 8 | ||
138 | nop | ||
139 | 4: or r3, r0, r0 | ||
140 | 1: lbu r4,r6,r3 | ||
141 | 2: sb r4,r5,r3 | ||
142 | addik r7,r7,-1 | ||
143 | bneid r7,1b | ||
144 | addik r3,r3,1 /* delay slot */ | ||
134 | 3: | 145 | 3: |
146 | addik r3,r7,0 | ||
135 | rtsd r15,8 | 147 | rtsd r15,8 |
136 | nop | 148 | nop |
137 | .size __copy_tofrom_user, . - __copy_tofrom_user | 149 | .size __copy_tofrom_user, . - __copy_tofrom_user |
138 | 150 | ||
139 | |||
140 | .section __ex_table,"a" | 151 | .section __ex_table,"a" |
141 | .word 1b,3b,2b,3b | 152 | .word 1b,3b,2b,3b,5b,3b,6b,3b |