From owner-freebsd-arm@FreeBSD.ORG Fri Feb 8 22:21:25 2013 Return-Path: Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5B785FDB; Fri, 8 Feb 2013 22:21:25 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 709CD647; Fri, 8 Feb 2013 22:21:18 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.6/8.14.6) with ESMTP id r18MLHXR017153; Fri, 8 Feb 2013 15:21:17 -0700 (MST) (envelope-from ian@FreeBSD.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r18MLFE3036289; Fri, 8 Feb 2013 15:21:15 -0700 (MST) (envelope-from ian@FreeBSD.org) Subject: Re: named kills raspberry pi From: Ian Lepore To: Andrew Turner In-Reply-To: <20130209102413.5c5d8fe6@bender> References: <20130207223038.ec308967273d6a16c41be97b@sohara.org> <20130208075702.a755649a60d10dabf10a058b@sohara.org> <0B9B84F3-D627-497F-B1DA-BE4D0F9BC5DA@bsdimp.com> <20130208121803.e6b57c3822271cce6e56b4b2@sohara.org> <20130208152351.GB19514@FreeBSD.org> <20130208162814.346c605ce15a229e878dee27@sohara.org> <20130209102413.5c5d8fe6@bender> Content-Type: text/plain; charset="ISO-8859-1" Date: Fri, 08 Feb 2013 15:21:15 -0700 Message-ID: <1360362075.4545.32.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 8bit Cc: Tim Kientzle , freebsd-arm@FreeBSD.org, Romain =?ISO-8859-1?Q?Tarti=E8re?= X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 22:21:25 -0000 On Sat, 2013-02-09 at 10:24 +1300, Andrew Turner wrote: > On Fri, 8 Feb 2013 16:28:14 +0000 > Steve O'Hara-Smith wrote: > > > On Fri, 8 Feb 2013 16:23:51 +0100 > > Romain Tartière wrote: > > > > > Hi > > > > > > On Fri, Feb 08, 2013 at 12:18:03PM +0000, Steve O'Hara-Smith wrote: > > > > I had a nasty feeling it might be, I was just hoping it might > > > > still work anyway. Failing that I'll look into an armv6 > > > > implementation of cpmxchg. Either way if I get it to work I'll > > > > post a patch to this list. > > > > > > First of all, please note that I am only an ARM user and never > > > hacked or whatever for ARM, so this could be completely out-topic, > > > please accept my apologies if it's the case :-) > > > > That's a nice clean copy of the three year old fix I > > mentioned. > > > > It doesn't solve my problem, but it probably should be > > committed. > > > > Can you try this patch [1]. It should fix the arm isc_atomic_cmpxchg > and add an armv6 implementation. I wrote it without knowing about > Romain's patch but it appears our armv[45] changes are almost identical. I think the armv6/7 sequence can be shortened to this, to provide branchless execution in all cases except losing the race when access is contended... __asm __volatile("1:\n" + "ldrex %0, [%1]\n" + "cmp %0, %2\n" + "strexeq %4, %3, [%1]\n" + "eoreqs %4, #1\n" + "beq 1b\n" + : "=&r" (done), "+r" (p), "+r" (cmpval), "+r" (val), "+r " (tmp) + : : "cc", "memory"); +#else (Not tested at all except in my brain, which is known to have a mile-long errata list.) -- Ian