Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/machine/rx/mempcpy.S')
-rw-r--r--newlib/libc/machine/rx/mempcpy.S17
1 files changed, 17 insertions, 0 deletions
diff --git a/newlib/libc/machine/rx/mempcpy.S b/newlib/libc/machine/rx/mempcpy.S
index c679d04ce..f82452462 100644
--- a/newlib/libc/machine/rx/mempcpy.S
+++ b/newlib/libc/machine/rx/mempcpy.S
@@ -4,5 +4,22 @@
.global _mempcpy
.type _mempcpy,@function
_mempcpy:
+#ifdef __RX_DISALLOW_STRING_INSNS__
+ /* Do not use the string instructions - they might prefetch
+ bytes from outside of valid memory. This is particularly
+ dangerous in I/O space. */
+
+ cmp #0, r3 ; If the count is zero, do nothing
+ beq 2f
+
+1: mov.b [r2+], r5
+ mov.b r5, [r1+]
+ sub #1, r3
+ bne 1b
+
+2: rts
+#else
smovf
rts
+#endif
+ .size _mempcpy, . - _mempcpy