X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/b0d623f7f2ae71ed96e60569f61f9a9a27016e80..008676633c2ad2c325837c2b64915f7ded690a8f:/osfmk/x86_64/bzero.s diff --git a/osfmk/x86_64/bzero.s b/osfmk/x86_64/bzero.s index cb2426300..be490d18c 100644 --- a/osfmk/x86_64/bzero.s +++ b/osfmk/x86_64/bzero.s @@ -84,11 +84,33 @@ ENTRY(memset) movq %r8 ,%rax /* returns its first argument */ ret +/* + * void *memset_word(void * addr, int pattern, size_t length) + */ + +ENTRY(memset_word) + movq %rdi, %r8 + movq %rsi, %rax /* move pattern (arg2) to rax */ + mov %eax, %ecx + shlq $32,%rax + orq %rcx, %rax + cld /* reset direction flag */ + movq %rdx, %rcx /* mov quads first */ + shrq $1, %rcx + rep + stosq + movq %rdx,%rcx /* if necessary, mov 32 bit word */ + andq $1,%rcx + rep + stosl + movq %r8 ,%rax /* returns its first argument */ + ret + /* * void bzero(char * addr, size_t length) */ Entry(blkclr) -ENTRY(bzero) +ENTRY2(bzero,__bzero) movq %rsi,%rcx xorq %rax,%rax shrq $3,%rcx