From owner-freebsd-mips@FreeBSD.ORG Tue Feb 22 08:03:58 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDEB21065672; Tue, 22 Feb 2011 08:03:58 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id F21968FC16; Tue, 22 Feb 2011 08:03:57 +0000 (UTC) Received: by wwf26 with SMTP id 26so6777185wwf.31 for ; Tue, 22 Feb 2011 00:03:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=BPPKai03wHYTdVzkxldv+nZrX+1MchNDHbux4re2vYI=; b=Cn+F7gzBiv2+L4KIWjWXxwzGXMy2KFHAaUn8PPLOfuMf0Do1wE+vEVU6h9Dz0sW6UK Effqf7cevkAs218ovR8sWjVvoj7NOZ4lBuwlgkQ76rcTB7Dj9RJ5PmlaUv14NV+f0zGP 4SEUShjCzbyQBC0gkS4d8ZBKC+ymavyhozL+c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=fwdzCPpfWv2fy2+zoluNJCLuKCTb7atxvsH/KaQzSLWM79HxV1otBAjqZEjHbDFXtK aOIF0YXRtDG2xNqpCawGH9FS1NhUbGs/kqEU+MBENQfEuLJhfCOOGKt3RRVRsuErQSoC Rf9KmefoDw+5z3iNmnj/ggOX/V3dwhFgQQ/Mw= MIME-Version: 1.0 Received: by 10.227.137.5 with SMTP id u5mr2036675wbt.6.1298361836320; Tue, 22 Feb 2011 00:03:56 -0800 (PST) Received: by 10.227.132.144 with HTTP; Tue, 22 Feb 2011 00:03:56 -0800 (PST) In-Reply-To: References: Date: Tue, 22 Feb 2011 13:33:56 +0530 Message-ID: From: "Jayachandran C." To: Artem Belevich Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips@freebsd.org Subject: Re: lib/libc/mips/string/bzero.S -- problem in 64-bit mode. X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Feb 2011 08:03:58 -0000 On Tue, Feb 22, 2011 at 11:09 AM, Artem Belevich 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.