Changeset a68003f in mainline
- Timestamp:
- 2005-09-19T20:20:14Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b4865e1
- Parents:
- a2dc632
- Files:
-
- 5 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/include/asm.h
ra2dc632 ra68003f 1 1 /* 2 2 * Copyright (C) 2001-2004 Jakub Jermar 3 * Copyright (C) 2005 HelenOS project 3 4 * All rights reserved. 4 5 * … … 213 214 } 214 215 215 /** Copy memory216 *217 * Copy a given number of bytes (3rd argument)218 * from the memory location defined by 2nd argument219 * to the memory location defined by 1st argument.220 * The memory areas cannot overlap.221 *222 * @param destination223 * @param source224 * @param number of bytes225 * @return destination226 */227 static inline void * memcpy(void * dst, const void * src, size_t cnt)228 {229 __u32 d0, d1, d2;230 231 __asm__ __volatile__(232 /* copy all full dwords */233 "rep movsl\n\t"234 /* load count again */235 "movl %4, %%ecx\n\t"236 /* ecx = ecx mod 4 */237 "andl $3, %%ecx\n\t"238 /* are there last <=3 bytes? */239 "jz 1f\n\t"240 /* copy last <=3 bytes */241 "rep movsb\n\t"242 /* exit from asm block */243 "1:\n"244 : "=&c" (d0), "=&D" (d1), "=&S" (d2)245 : "0" (cnt / 4), "g" (cnt), "1" ((__u32) dst), "2" ((__u32) src)246 : "memory");247 248 return dst;249 }250 251 252 216 #endif -
include/memstr.h
ra2dc632 ra68003f 32 32 #include <typedefs.h> 33 33 #include <arch/types.h> 34 #include <arch/ asm.h>34 #include <arch/memstr.h> 35 35 36 /* 36 37 extern void memsetw(__address dst, size_t cnt, __u16 x); 37 38 extern void memsetb(__address dst, size_t cnt, __u8 x); 38 39 39 extern int memcmp(__address src, __address dst, int cnt); 40 extern void *memcpy(void *dst, const void *src, size_t cnt); 40 extern void * memcpy(void *dst, const void *src, size_t cnt); 41 */ 41 42 42 43 /*
Note:
See TracChangeset
for help on using the changeset viewer.