mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 05:25:48 +00:00
Create a branch for network fixes.
svn path=/branches/aicom-network-fixes/; revision=34994
This commit is contained in:
parent
0e213bbc00
commit
c501d8112c
18148 changed files with 0 additions and 860488 deletions
31
lib/sdk/crt/mem/i386/memchr_asm.s
Normal file
31
lib/sdk/crt/mem/i386/memchr_asm.s
Normal file
|
@ -0,0 +1,31 @@
|
|||
/* $Id$
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: lib/string/i386/memchr.s
|
||||
*/
|
||||
|
||||
/*
|
||||
* void* memchr(const void* s, int c, size_t n)
|
||||
*/
|
||||
|
||||
.globl _memchr
|
||||
|
||||
_memchr:
|
||||
push %ebp
|
||||
mov %esp,%ebp
|
||||
push %edi
|
||||
mov 0x8(%ebp),%edi
|
||||
mov 0xc(%ebp),%eax
|
||||
mov 0x10(%ebp),%ecx
|
||||
cld
|
||||
repne scasb
|
||||
je .L1
|
||||
mov $1,%edi
|
||||
.L1:
|
||||
mov %edi,%eax
|
||||
dec %eax
|
||||
pop %edi
|
||||
leave
|
||||
ret
|
||||
|
48
lib/sdk/crt/mem/i386/memcpy_asm.s
Normal file
48
lib/sdk/crt/mem/i386/memcpy_asm.s
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* void *memcpy (void *to, const void *from, size_t count)
|
||||
*
|
||||
* Some optimization research can be found in media/doc/memcpy_optimize.txt
|
||||
*/
|
||||
|
||||
.globl _memcpy
|
||||
|
||||
_memcpy:
|
||||
push %ebp
|
||||
mov %esp,%ebp
|
||||
push %esi
|
||||
push %edi
|
||||
mov 0x8(%ebp),%edi
|
||||
mov 0xc(%ebp),%esi
|
||||
mov 0x10(%ebp),%ecx
|
||||
cld
|
||||
cmp $16,%ecx
|
||||
jb .L1
|
||||
mov %ecx,%edx
|
||||
test $3,%edi
|
||||
je .L2
|
||||
/*
|
||||
* Make the destination dword aligned
|
||||
*/
|
||||
mov %edi,%ecx
|
||||
and $3,%ecx
|
||||
sub $5,%ecx
|
||||
not %ecx
|
||||
sub %ecx,%edx
|
||||
rep movsb
|
||||
mov %edx,%ecx
|
||||
.L2:
|
||||
shr $2,%ecx
|
||||
rep movsl
|
||||
mov %edx,%ecx
|
||||
and $3,%ecx
|
||||
.L1:
|
||||
test %ecx,%ecx
|
||||
je .L3
|
||||
rep movsb
|
||||
.L3:
|
||||
pop %edi
|
||||
pop %esi
|
||||
mov 0x8(%ebp),%eax
|
||||
leave
|
||||
ret
|
||||
|
116
lib/sdk/crt/mem/i386/memmove_asm.s
Normal file
116
lib/sdk/crt/mem/i386/memmove_asm.s
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* void *memmove (void *to, const void *from, size_t count)
|
||||
*/
|
||||
|
||||
.globl _memmove
|
||||
|
||||
_memmove:
|
||||
push %ebp
|
||||
mov %esp,%ebp
|
||||
|
||||
push %esi
|
||||
push %edi
|
||||
|
||||
mov 8(%ebp),%edi
|
||||
mov 12(%ebp),%esi
|
||||
mov 16(%ebp),%ecx
|
||||
|
||||
cmp %esi,%edi
|
||||
jbe .CopyUp
|
||||
mov %ecx,%eax
|
||||
add %esi,%eax
|
||||
cmp %eax,%edi
|
||||
jb .CopyDown
|
||||
|
||||
.CopyUp:
|
||||
cld
|
||||
|
||||
cmp $16,%ecx
|
||||
jb .L1
|
||||
mov %ecx,%edx
|
||||
test $3,%edi
|
||||
je .L2
|
||||
/*
|
||||
* Make the destination dword aligned
|
||||
*/
|
||||
mov %edi,%ecx
|
||||
and $3,%ecx
|
||||
sub $5,%ecx
|
||||
not %ecx
|
||||
sub %ecx,%edx
|
||||
rep movsb
|
||||
mov %edx,%ecx
|
||||
.L2:
|
||||
shr $2,%ecx
|
||||
rep movsl
|
||||
mov %edx,%ecx
|
||||
and $3,%ecx
|
||||
.L1:
|
||||
test %ecx,%ecx
|
||||
je .L3
|
||||
rep movsb
|
||||
.L3:
|
||||
mov 8(%ebp),%eax
|
||||
pop %edi
|
||||
pop %esi
|
||||
leave
|
||||
ret
|
||||
|
||||
.CopyDown:
|
||||
std
|
||||
|
||||
add %ecx,%edi
|
||||
add %ecx,%esi
|
||||
|
||||
cmp $16,%ecx
|
||||
jb .L4
|
||||
mov %ecx,%edx
|
||||
test $3,%edi
|
||||
je .L5
|
||||
|
||||
/*
|
||||
* Make the destination dword aligned
|
||||
*/
|
||||
mov %edi,%ecx
|
||||
and $3,%ecx
|
||||
sub %ecx,%edx
|
||||
dec %esi
|
||||
dec %edi
|
||||
rep movsb
|
||||
mov %edx,%ecx
|
||||
|
||||
sub $3,%esi
|
||||
sub $3,%edi
|
||||
.L6:
|
||||
shr $2,%ecx
|
||||
rep movsl
|
||||
mov %edx,%ecx
|
||||
and $3,%ecx
|
||||
je .L7
|
||||
add $3,%esi
|
||||
add $3,%edi
|
||||
.L8:
|
||||
rep movsb
|
||||
.L7:
|
||||
cld
|
||||
mov 8(%ebp),%eax
|
||||
pop %edi
|
||||
pop %esi
|
||||
leave
|
||||
ret
|
||||
.L5:
|
||||
sub $4,%edi
|
||||
sub $4,%esi
|
||||
jmp .L6
|
||||
|
||||
.L4:
|
||||
test %ecx,%ecx
|
||||
je .L7
|
||||
dec %esi
|
||||
dec %edi
|
||||
jmp .L8
|
||||
|
47
lib/sdk/crt/mem/i386/memset_asm.s
Normal file
47
lib/sdk/crt/mem/i386/memset_asm.s
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* void *memset (void *src, int val, size_t count)
|
||||
*/
|
||||
|
||||
.globl _memset
|
||||
|
||||
_memset:
|
||||
push %ebp
|
||||
mov %esp,%ebp
|
||||
push %edi
|
||||
mov 0x8(%ebp),%edi
|
||||
movzb 0xc(%ebp),%eax
|
||||
mov 0x10(%ebp),%ecx
|
||||
cld
|
||||
cmp $16,%ecx
|
||||
jb .L1
|
||||
mov $0x01010101,%edx
|
||||
mul %edx
|
||||
mov %ecx,%edx
|
||||
test $3,%edi
|
||||
je .L2
|
||||
mov %edi,%ecx
|
||||
and $3,%ecx
|
||||
sub $5,%ecx
|
||||
not %ecx
|
||||
sub %ecx,%edx
|
||||
rep stosb
|
||||
mov %edx,%ecx
|
||||
.L2:
|
||||
shr $2,%ecx
|
||||
rep stosl
|
||||
mov %edx,%ecx
|
||||
and $3,%ecx
|
||||
.L1:
|
||||
test %ecx,%ecx
|
||||
je .L3
|
||||
rep stosb
|
||||
.L3:
|
||||
pop %edi
|
||||
mov 0x8(%ebp),%eax
|
||||
leave
|
||||
ret
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue