Changeset 2d7a5fe in mainline
- Timestamp:
- 2006-06-06T15:42:36Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ae3f1709
- Parents:
- e269c53
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/lib/memstr.c
re269c53 r2d7a5fe 41 41 #include <memstr.h> 42 42 #include <arch/types.h> 43 #include <align.h> 43 44 44 45 /** Copy block of memory … … 57 58 int i, j; 58 59 59 for (i = 0; i < cnt/sizeof(__native); i++) 60 ((__native *) dst)[i] = ((__native *) src)[i]; 60 if (ALIGN_UP((__address) src, sizeof(__native)) != (__address) src || 61 ALIGN_UP((__address) dst, sizeof(__native)) != (__address) dst) { 62 for (i = 0; i < cnt; i++) 63 ((__u8 *) dst)[i] = ((__u8 *) src)[i]; 64 } else { 65 66 for (i = 0; i < cnt/sizeof(__native); i++) 67 ((__native *) dst)[i] = ((__native *) src)[i]; 61 68 62 for (j = 0; j < cnt%sizeof(__native); j++) 63 ((__u8 *)(((__native *) dst) + i))[j] = ((__u8 *)(((__native *) src) + i))[j]; 69 for (j = 0; j < cnt%sizeof(__native); j++) 70 ((__u8 *)(((__native *) dst) + i))[j] = ((__u8 *)(((__native *) src) + i))[j]; 71 } 64 72 65 73 return (char *)src;
Note:
See TracChangeset
for help on using the changeset viewer.