named kills raspberry pi

Ian Lepore ian at FreeBSD.org
Fri Feb 8 22:21:25 UTC 2013


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 at sohara.org> wrote:
> 
> > On Fri, 8 Feb 2013 16:23:51 +0100
> > Romain Tartière <romain at 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




More information about the freebsd-arm mailing list