123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- #include <string.h>
- #include "memcopy.h"
- #include "../generic/pagecopy.h"
- void *memmove (void *dest, const void *src, size_t len)
- {
- unsigned long int dstp = (long int) dest;
- unsigned long int srcp = (long int) src;
-
- if (dstp - srcp >= len)
- {
- #if 1
- #warning REMINDER: Cris arch-opt memmove assumes memcpy does forward copying!
- memcpy(dest, src, len);
- #else
-
-
- if (len >= OP_T_THRES)
- {
-
- len -= (-dstp) % OPSIZ;
- BYTE_COPY_FWD (dstp, srcp, (-dstp) % OPSIZ);
-
- PAGE_COPY_FWD_MAYBE (dstp, srcp, len, len);
-
- WORD_COPY_FWD (dstp, srcp, len, len);
-
- }
-
- BYTE_COPY_FWD (dstp, srcp, len);
- #endif
- }
- else
- {
-
- srcp += len;
- dstp += len;
-
- if (len >= OP_T_THRES)
- {
-
- len -= dstp % OPSIZ;
- BYTE_COPY_BWD (dstp, srcp, dstp % OPSIZ);
-
- WORD_COPY_BWD (dstp, srcp, len, len);
-
- }
-
- BYTE_COPY_BWD (dstp, srcp, len);
- }
- return (dest);
- }
- libc_hidden_def(memmove)
|