Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Feb 2011 13:33:56 +0530
From:      "Jayachandran C." <c.jayachandran@gmail.com>
To:        Artem Belevich <fbsdlist@src.cx>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: lib/libc/mips/string/bzero.S -- problem in 64-bit mode.
Message-ID:  <AANLkTikGvZ%2Bc_QLodMHq1O0-KWFc8G_TxBOU4bfHYWJN@mail.gmail.com>
In-Reply-To: <AANLkTin7%2Bf5v6fBX-TeMt=BxrH_3r1Qb_Y_y=HJ08Z=K@mail.gmail.com>
References:  <AANLkTik2evgf4-k85P%2Bsm953ofa0=UNd7o2uWhQw7qiB@mail.gmail.com> <AANLkTim83G00D_xw1tyK8qyVwOWL6-_ivpt-zDOoe3-U@mail.gmail.com> <AANLkTin7%2Bf5v6fBX-TeMt=BxrH_3r1Qb_Y_y=HJ08Z=K@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Feb 22, 2011 at 11:09 AM, Artem Belevich <fbsdlist@src.cx> wrote:
>> I just tested this with a simple program - and there is certainly an
>> issue here. =A0If 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=3D=3D8 cas=
e,
>> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikGvZ%2Bc_QLodMHq1O0-KWFc8G_TxBOU4bfHYWJN>