Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/generic/src/memstr.c

    r1715b7fe r9d58539  
    3535 * memory areas cannot overlap.
    3636 *
    37  * @param src Source address to copy from.
    38  * @param dst Destination address to copy to.
    39  * @param cnt Number of bytes to copy.
     37 * @param src           Source address to copy from.
     38 * @param dst           Destination address to copy to.
     39 * @param cnt           Number of bytes to copy.
    4040 *
    41  * @return Destination address.
    42  *
     41 * @return              Destination address.
    4342 */
    4443void *memcpy(void *dst, const void *src, size_t cnt)
    4544{
    46         return __builtin_memcpy(dst, src, cnt);
    47 }
     45        size_t i;
    4846
    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);
     47        for (i = 0; i < cnt; i++)
     48                ((uint8_t *) dst)[i] = ((uint8_t *) src)[i];
     49
     50        return dst;
    6351}
    6452
Note: See TracChangeset for help on using the changeset viewer.