Changeset 7a255e69 in mainline
- Timestamp:
- 2006-02-26T11:58:27Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7cb53f62
- Parents:
- a0c732e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/lib/memstr.c
ra0c732e r7a255e69 30 30 #include <arch/types.h> 31 31 32 33 32 /** Copy block of memory 34 33 * 35 34 * Copy cnt bytes from src address to dst address. 36 * The copying is done byte-by-byte. The source37 * and destination memory areas cannot overlap.35 * The copying is done word-by-word and then byte-by-byte. 36 * The source and destination memory areas cannot overlap. 38 37 * 39 38 * @param src Origin address to copy from. … … 44 43 void *_memcpy(void * dst, const void *src, size_t cnt) 45 44 { 46 int i ;45 int i, j; 47 46 48 for (i=0; i<cnt; i++) 49 *((__u8 *) (dst + i)) = *((__u8 *) (src + i)); 47 for (i = 0; i < cnt/sizeof(__native); i++) 48 ((__native *) dst)[i] = ((__native *) src)[i]; 49 50 for (j = 0; j < cnt%sizeof(__native); j++) 51 ((__u8 *)(((__native *) dst) + i))[j] = ((__u8 *)(((__native *) src) + i))[j]; 50 52 51 53 return (char *)src;
Note:
See TracChangeset
for help on using the changeset viewer.