lib/libc/mips/string/bzero.S -- problem in 64-bit mode.
Jayachandran C.
c.jayachandran at gmail.com
Tue Feb 22 08:03:58 UTC 2011
On Tue, Feb 22, 2011 at 11:09 AM, Artem Belevich <fbsdlist at src.cx> wrote:
>> I just tested this with a simple program - and there is certainly an
>> issue here. If you can send me a patch, I can check that in after
>> testing.
>
> Try attached diff.
Thanks! The patch is checked in now:
| New Revision: 218939
| URL: http://svn.freebsd.org/changeset/base/218939
|
| Log:
| Fix bzero() for 64-bit.
|
| The existing implementation of bzero incorrectly clears bytes when the
| start address is not word aligned. Fix it by using REG_SHI macro which
| works on both 32 and 64 bit.
|
| Submitted by: Artem Belevich (fbsdlist at src cx)
>> The kernel version of bzero() does not seem to have the SZREG==8 case,
>> and this bug.
>
> True. It still uses 32-bit sw to zero stuff out. There are number of
> routines in the kernel that could take advantage of 64-bit
> instructions.
I have not really looked at assembly for bcopy/bcmp/bzero for kernel
or user space for 64 bit optimizations yet..
JC.
More information about the freebsd-mips
mailing list