1/* 2Copyright (c) 2009 Nick Clifton <nickc@redhat.com> 3 */ 4#include <picolibc.h> 5 6 .file "mempcpy.S" 7 8 .section .text 9 .global _mempcpy 10 .type _mempcpy,@function 11_mempcpy: 12#ifdef __RX_DISALLOW_STRING_INSNS__ 13 /* Do not use the string instructions - they might prefetch 14 bytes from outside of valid memory. This is particularly 15 dangerous in I/O space. */ 16 17 cmp #0, r3 ; If the count is zero, do nothing 18 beq 2f 19 201: mov.b [r2+], r5 21 mov.b r5, [r1+] 22 sub #1, r3 23 bne 1b 24 252: rts 26#else 27 smovf 28 rts 29#endif 30 .size _mempcpy, . - _mempcpy 31