Changeset 5d9fce4 in mainline
- Timestamp:
- 2013-03-27T17:16:46Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 26c02b22, c6a7b3a
- Parents:
- 5c4356b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/generic/src/memstr.c
r5c4356b r5d9fce4 30 30 #include <typedefs.h> 31 31 32 /** Copy block of memory.32 /** Move memory block without overlapping. 33 33 * 34 * Copy cnt bytes from src address to dst address. The source and destination35 * memory areas cannot overlap.34 * Copy cnt bytes from src address to dst address. The source 35 * and destination memory areas cannot overlap. 36 36 * 37 * @param dst Destination address to copy to. 37 38 * @param src Source address to copy from. 38 * @param dst Destination address to copy to.39 39 * @param cnt Number of bytes to copy. 40 40 * … … 44 44 void *memcpy(void *dst, const void *src, size_t cnt) 45 45 { 46 return __builtin_memcpy(dst, src, cnt); 46 uint8_t *dp = (uint8_t *) dst; 47 const uint8_t *sp = (uint8_t *) src; 48 49 while (cnt-- != 0) 50 *dp++ = *sp++; 51 52 return dst; 47 53 } 48 54 … … 60 66 void *memset(void *dst, int val, size_t cnt) 61 67 { 62 return __builtin_memset(dst, val, cnt); 68 uint8_t *dp = (uint8_t *) dst; 69 70 while (cnt-- != 0) 71 *dp++ = val; 72 73 return dst; 63 74 } 64 75
Note:
See TracChangeset
for help on using the changeset viewer.