Rev 59 | Rev 72 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 59 | Rev 62 | ||
---|---|---|---|
Line 27... | Line 27... | ||
27 | */ |
27 | */ |
28 | 28 | ||
29 | #include <memstr.h> |
29 | #include <memstr.h> |
30 | #include <arch/types.h> |
30 | #include <arch/types.h> |
31 | 31 | ||
- | 32 | ||
- | 33 | /** Copy block of memory |
|
- | 34 | * |
|
- | 35 | * Copy cnt bytes from src address to dst address. |
|
- | 36 | * The copying is done byte-by-byte. The source |
|
- | 37 | * and destination memory areas cannot overlap. |
|
- | 38 | * |
|
- | 39 | * @param src Origin address to copy from. |
|
- | 40 | * @param dst Origin address to copy to. |
|
- | 41 | * @param cnt Number of bytes to copy. |
|
- | 42 | * |
|
- | 43 | */ |
|
32 | void _memcopy(__address src, __address dst, int cnt) |
44 | void _memcopy(__address src, __address dst, int cnt) |
33 | { |
45 | { |
34 | int i; |
46 | int i; |
35 | 47 | ||
36 | for (i=0; i<cnt; i++) |
48 | for (i=0; i<cnt; i++) |
37 | *((__u8 *) (dst + i)) = *((__u8 *) (src + i)); |
49 | *((__u8 *) (dst + i)) = *((__u8 *) (src + i)); |
38 | } |
50 | } |
39 | 51 | ||
- | 52 | ||
- | 53 | /** Fill block of memory |
|
- | 54 | * |
|
- | 55 | * Fill cnt bytes at dst address with the value x. |
|
- | 56 | * The filling is done byte-by-byte. |
|
- | 57 | * |
|
- | 58 | * @param dst Origin address to fill. |
|
- | 59 | * @param cnt Number of bytes to fill. |
|
- | 60 | * @param x Value to fill. |
|
- | 61 | * |
|
- | 62 | */ |
|
40 | void _memsetb(__address dst, int cnt, __u8 x) |
63 | void _memsetb(__address dst, int cnt, __u8 x) |
41 | { |
64 | { |
42 | int i; |
65 | int i; |
43 | __u8 *p = (__u8 *) dst; |
66 | __u8 *p = (__u8 *) dst; |
44 | 67 |