@@ -33,19 +33,20 @@ ENTRY(__asm_copy_from_user)
33
33
34
34
/*
35
35
* Use byte copy only if too small.
36
+ * SZREG holds 4 for RV32 and 8 for RV64
36
37
*/
37
38
li a3 , 9 *SZREG /* size must be larger than size in word_copy */
38
39
bltu a2 , a3 , .Lbyte_copy_tail
39
40
40
41
/*
41
- * Copy first bytes until dst is align to word boundary.
42
+ * Copy first bytes until dst is aligned to word boundary.
42
43
* a0 - start of dst
43
44
* t1 - start of aligned dst
44
45
*/
45
46
addi t1, a0 , SZREG-1
46
47
andi t1, t1, ~(SZREG-1 )
47
48
/* dst is already aligned, skip */
48
- beq a0 , t1, .Lskip_first_bytes
49
+ beq a0 , t1, .Lskip_align_dst
49
50
1 :
50
51
/* a5 - one byte for copying data */
51
52
fixup lb a5 , 0 (a1 ), 10f
@@ -54,7 +55,7 @@ ENTRY(__asm_copy_from_user)
54
55
addi a0 , a0 , 1 /* dst */
55
56
bltu a0 , t1, 1b /* t1 - start of aligned dst */
56
57
57
- .Lskip_first_bytes :
58
+ .Lskip_align_dst :
58
59
/*
59
60
* Now dst is aligned.
60
61
* Use shift-copy if src is misaligned.
@@ -71,7 +72,6 @@ ENTRY(__asm_copy_from_user)
71
72
*
72
73
* a0 - start of aligned dst
73
74
* a1 - start of aligned src
74
- * a3 - a1 & mask:(SZREG-1)
75
75
* t0 - end of aligned dst
76
76
*/
77
77
addi t0, t0, -(8 *SZREG) /* not to over run */
@@ -106,7 +106,7 @@ ENTRY(__asm_copy_from_user)
106
106
* For misaligned copy we still perform aligned word copy, but
107
107
* we need to use the value fetched from the previous iteration and
108
108
* do some shifts.
109
- * This is safe because reading less than a word size.
109
+ * This is safe because reading is less than a word size.
110
110
*
111
111
* a0 - start of aligned dst
112
112
* a1 - start of src
@@ -116,7 +116,7 @@ ENTRY(__asm_copy_from_user)
116
116
*/
117
117
/* calculating aligned word boundary for dst */
118
118
andi t1, t0, ~(SZREG-1 )
119
- /* Converting unaligned src to aligned arc */
119
+ /* Converting unaligned src to aligned src */
120
120
andi a1 , a1 , ~(SZREG-1 )
121
121
122
122
/*
@@ -128,7 +128,7 @@ ENTRY(__asm_copy_from_user)
128
128
li a5 , SZREG*8
129
129
sub t4, a5 , t3
130
130
131
- /* Load the first word to combine with seceond word */
131
+ /* Load the first word to combine with second word */
132
132
fixup REG_L a5 , 0 (a1 ), 10f
133
133
134
134
3 :
@@ -160,15 +160,15 @@ ENTRY(__asm_copy_from_user)
160
160
* a1 - start of remaining src
161
161
* t0 - end of remaining dst
162
162
*/
163
- bgeu a0 , t0, 5f
163
+ bgeu a0 , t0, .Lout_copy_user / * check if end of copy */
164
164
4 :
165
165
fixup lb a5 , 0 (a1 ), 10f
166
166
addi a1 , a1 , 1 /* src */
167
167
fixup sb a5 , 0 (a0 ), 10f
168
168
addi a0 , a0 , 1 /* dst */
169
169
bltu a0 , t0, 4b /* t0 - end of dst */
170
170
171
- 5 :
171
+ .Lout_copy_user :
172
172
/* Disable access to user memory */
173
173
csrc CSR_STATUS, t6
174
174
li a0 , 0
0 commit comments