From owner-freebsd-arm@FreeBSD.ORG Tue Apr 28 11:31:06 2009 Return-Path: Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 324A61065676; Tue, 28 Apr 2009 11:31:06 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from mail-gw1.york.ac.uk (mail-gw1.york.ac.uk [144.32.128.246]) by mx1.freebsd.org (Postfix) with ESMTP id BBE4D8FC35; Tue, 28 Apr 2009 11:31:05 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from mail-gw7.york.ac.uk (mail-gw7.york.ac.uk [144.32.129.30]) by mail-gw1.york.ac.uk (8.13.6/8.13.6) with ESMTP id n3SBV2LV008251; Tue, 28 Apr 2009 12:31:03 +0100 (BST) Received: from buffy-128.york.ac.uk ([144.32.128.160] helo=buffy.york.ac.uk) by mail-gw7.york.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1LylWg-00027h-Ug; Tue, 28 Apr 2009 12:31:02 +0100 Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.14.3/8.14.3) with ESMTP id n3SBV24c086794; Tue, 28 Apr 2009 12:31:02 +0100 (BST) (envelope-from gavin@FreeBSD.org) Received: (from ga9@localhost) by buffy.york.ac.uk (8.14.3/8.14.3/Submit) id n3SBV2Yw086793; Tue, 28 Apr 2009 12:31:02 +0100 (BST) (envelope-from gavin@FreeBSD.org) X-Authentication-Warning: buffy.york.ac.uk: ga9 set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson To: Channa In-Reply-To: <515c64960904280252sc9fe2afy24e8db8ab13b13e4@mail.gmail.com> References: <515c64960904280252sc9fe2afy24e8db8ab13b13e4@mail.gmail.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Tue, 28 Apr 2009 12:31:02 +0100 Message-Id: <1240918262.85945.1.camel@buffy.york.ac.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 FreeBSD GNOME Team Port X-York-MailScanner: Found to be clean X-York-MailScanner-From: gavin@freebsd.org Cc: freebsd-arm@FreeBSD.org Subject: Re: strncmp issue X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Apr 2009 11:31:06 -0000 This probably belongs on the -arm list, which I'm CCing. On Tue, 2009-04-28 at 15:22 +0530, Channa wrote: > Hi, > > I am using the freebsd implementation of strncmp for ARM which is an > assembly implementation. > I have a small doubt, when i tested the strncmp by passing the third argument: > 'n' as -1 the return values is '0' instead it should '-1'. > When the third argument to strncmp is as below: > > ret = strncmp("a","b",-1) > > I think the assembly implementation in > src/lib/libc/arm/string/strncmp.S file needs > to be modified to take care of the above condition. > > In the current implementation > /* if ((len - 1) < 0) return 0 */ > subs r2, r2, #1 > movmi r0, #0 > RETc(mi) > > This should be changed to check as below > > /* if ((len ) < 0) return 0 */ > /* Assembly code here */ > > Could anyone help in solving the above issue.? > > Thanks & Regards, > Channagoud > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"