Changeset 1715b7fe in mainline
- Timestamp:
- 2013-03-25T19:42:07Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5c4356b
- Parents:
- 2a08005
- Location:
- boot/generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/generic/include/memstr.h
r2a08005 r1715b7fe 36 36 37 37 extern void *memcpy(void *, const void *, size_t); 38 extern void *memset(void *, int, size_t); 38 39 extern void *memmove(void *, const void *, size_t); 39 40 -
boot/generic/src/memstr.c
r2a08005 r1715b7fe 35 35 * memory areas cannot overlap. 36 36 * 37 * @param src 38 * @param dst 39 * @param cnt 37 * @param src Source address to copy from. 38 * @param dst Destination address to copy to. 39 * @param cnt Number of bytes to copy. 40 40 * 41 * @return Destination address. 41 * @return Destination address. 42 * 42 43 */ 43 44 void *memcpy(void *dst, const void *src, size_t cnt) 44 45 { 45 size_t i; 46 return __builtin_memcpy(dst, src, cnt); 47 } 46 48 47 for (i = 0; i < cnt; i++) 48 ((uint8_t *) dst)[i] = ((uint8_t *) src)[i]; 49 50 return dst; 49 /** Fill block of memory. 50 * 51 * Fill cnt bytes at dst address with the value val. 52 * 53 * @param dst Destination address to fill. 54 * @param val Value to fill. 55 * @param cnt Number of bytes to fill. 56 * 57 * @return Destination address. 58 * 59 */ 60 void *memset(void *dst, int val, size_t cnt) 61 { 62 return __builtin_memset(dst, val, cnt); 51 63 } 52 64
Note:
See TracChangeset
for help on using the changeset viewer.