hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/mips/lib/memcpy.S
....@@ -204,9 +204,10 @@
204204 #define LOADB(reg, addr, handler) EXC(lb, LD_INSN, reg, addr, handler)
205205 #define STOREB(reg, addr, handler) EXC(sb, ST_INSN, reg, addr, handler)
206206
207
-#define _PREF(hint, addr, type) \
207
+#ifdef CONFIG_CPU_HAS_PREFETCH
208
+# define _PREF(hint, addr, type) \
208209 .if \mode == LEGACY_MODE; \
209
- PREF(hint, addr); \
210
+ kernel_pref(hint, addr); \
210211 .else; \
211212 .if ((\from == USEROP) && (type == SRC_PREFETCH)) || \
212213 ((\to == USEROP) && (type == DST_PREFETCH)); \
....@@ -218,12 +219,15 @@
218219 * used later on. Therefore use $v1. \
219220 */ \
220221 .set at=v1; \
221
- PREFE(hint, addr); \
222
+ user_pref(hint, addr); \
222223 .set noat; \
223224 .else; \
224
- PREF(hint, addr); \
225
+ kernel_pref(hint, addr); \
225226 .endif; \
226227 .endif
228
+#else
229
+# define _PREF(hint, addr, type)
230
+#endif
227231
228232 #define PREFS(hint, addr) _PREF(hint, addr, SRC_PREFETCH)
229233 #define PREFD(hint, addr) _PREF(hint, addr, DST_PREFETCH)
....@@ -297,14 +301,14 @@
297301 and t0, src, ADDRMASK
298302 PREFS( 0, 2*32(src) )
299303 PREFD( 1, 2*32(dst) )
300
-#ifndef CONFIG_CPU_MIPSR6
304
+#ifndef CONFIG_CPU_NO_LOAD_STORE_LR
301305 bnez t1, .Ldst_unaligned\@
302306 nop
303307 bnez t0, .Lsrc_unaligned_dst_aligned\@
304
-#else
308
+#else /* CONFIG_CPU_NO_LOAD_STORE_LR */
305309 or t0, t0, t1
306310 bnez t0, .Lcopy_unaligned_bytes\@
307
-#endif
311
+#endif /* CONFIG_CPU_NO_LOAD_STORE_LR */
308312 /*
309313 * use delay slot for fall-through
310314 * src and dst are aligned; need to compute rem
....@@ -385,7 +389,7 @@
385389 bne rem, len, 1b
386390 .set noreorder
387391
388
-#ifndef CONFIG_CPU_MIPSR6
392
+#ifndef CONFIG_CPU_NO_LOAD_STORE_LR
389393 /*
390394 * src and dst are aligned, need to copy rem bytes (rem < NBYTES)
391395 * A loop would do only a byte at a time with possible branch
....@@ -487,7 +491,7 @@
487491 bne len, rem, 1b
488492 .set noreorder
489493
490
-#endif /* !CONFIG_CPU_MIPSR6 */
494
+#endif /* !CONFIG_CPU_NO_LOAD_STORE_LR */
491495 .Lcopy_bytes_checklen\@:
492496 beqz len, .Ldone\@
493497 nop
....@@ -516,7 +520,7 @@
516520 jr ra
517521 nop
518522
519
-#ifdef CONFIG_CPU_MIPSR6
523
+#ifdef CONFIG_CPU_NO_LOAD_STORE_LR
520524 .Lcopy_unaligned_bytes\@:
521525 1:
522526 COPY_BYTE(0)
....@@ -530,7 +534,7 @@
530534 ADD src, src, 8
531535 b 1b
532536 ADD dst, dst, 8
533
-#endif /* CONFIG_CPU_MIPSR6 */
537
+#endif /* CONFIG_CPU_NO_LOAD_STORE_LR */
534538 .if __memcpy == 1
535539 END(memcpy)
536540 .set __memcpy, 0
....@@ -594,6 +598,7 @@
594598 nop
595599 .endm
596600
601
+#ifndef CONFIG_HAVE_PLAT_MEMCPY
597602 .align 5
598603 LEAF(memmove)
599604 EXPORT_SYMBOL(memmove)
....@@ -661,6 +666,8 @@
661666 /* Legacy Mode, user <-> user */
662667 __BUILD_COPY_USER LEGACY_MODE USEROP USEROP
663668
669
+#endif
670
+
664671 #ifdef CONFIG_EVA
665672
666673 /*