Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 08 Feb 2013 15:21:15 -0700
From:      Ian Lepore <ian@FreeBSD.org>
To:        Andrew Turner <andrew@fubar.geek.nz>
Cc:        Tim Kientzle <tim@kientzle.com>, freebsd-arm@FreeBSD.org, Romain =?ISO-8859-1?Q?Tarti=E8re?= <romain@FreeBSD.org>
Subject:   Re: named kills raspberry pi
Message-ID:  <1360362075.4545.32.camel@revolution.hippie.lan>
In-Reply-To: <20130209102413.5c5d8fe6@bender>
References:  <20130207223038.ec308967273d6a16c41be97b@sohara.org> <E2B20243-F2AD-4B62-946D-374765CB9E39@kientzle.com> <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>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <steve@sohara.org> wrote:
> 
> > On Fri, 8 Feb 2013 16:23:51 +0100
> > Romain Tartière <romain@FreeBSD.org> 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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1360362075.4545.32.camel>