diff options
author | kib <kib@FreeBSD.org> | 2013-07-13 19:42:52 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-07-13 19:42:52 +0000 |
commit | b39f8344132db7671f6bb0129eca537f84d0cdcd (patch) | |
tree | e243b98e5200ab48a6c2b52ac4896f7be3ae5bc8 /sys | |
parent | cbf04bd9c1b7afe2cb170aca104d173904684d84 (diff) | |
download | FreeBSD-src-b39f8344132db7671f6bb0129eca537f84d0cdcd.zip FreeBSD-src-b39f8344132db7671f6bb0129eca537f84d0cdcd.tar.gz |
Create a proper stack frame for i386 version of bcopy(), despite the
function is leaf. The frame allows ddb to not loose the direct caller
of bcopy() in backtrace.
Other functions from support.s would benefit from the same change as
well, but for now bcopy() is the most frequent offender.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/i386/support.s | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/i386/i386/support.s b/sys/i386/i386/support.s index 967a09e..779fa38 100644 --- a/sys/i386/i386/support.s +++ b/sys/i386/i386/support.s @@ -181,11 +181,13 @@ END(bcopyb) * ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800 */ ENTRY(bcopy) + pushl %ebp + movl %esp,%ebp pushl %esi pushl %edi - movl 12(%esp),%esi - movl 16(%esp),%edi - movl 20(%esp),%ecx + movl 8(%ebp),%esi + movl 12(%ebp),%edi + movl 16(%ebp),%ecx movl %edi,%eax subl %esi,%eax @@ -196,12 +198,13 @@ ENTRY(bcopy) cld /* nope, copy forwards */ rep movsl - movl 20(%esp),%ecx + movl 16(%ebp),%ecx andl $3,%ecx /* any bytes left? */ rep movsb popl %edi popl %esi + popl %ebp ret ALIGN_TEXT @@ -214,7 +217,7 @@ ENTRY(bcopy) std rep movsb - movl 20(%esp),%ecx /* copy remainder by 32-bit words */ + movl 16(%ebp),%ecx /* copy remainder by 32-bit words */ shrl $2,%ecx subl $3,%esi subl $3,%edi @@ -223,6 +226,7 @@ ENTRY(bcopy) popl %edi popl %esi cld + popl %ebp ret END(bcopy) |