From owner-freebsd-current@FreeBSD.ORG Fri Feb 19 16:49:03 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA330106566C; Fri, 19 Feb 2010 16:49:03 +0000 (UTC) (envelope-from mlfbsd@kanar.ci0.org) Received: from kanar.ci0.org (unknown [IPv6:2a01:e0b:1:50:40:63ff:feea:93a]) by mx1.freebsd.org (Postfix) with ESMTP id 4F7978FC1F; Fri, 19 Feb 2010 16:49:02 +0000 (UTC) Received: from kanar.ci0.org (pluxor@localhost [127.0.0.1]) by kanar.ci0.org (8.14.2/8.14.3) with ESMTP id o1JGnxCp008257; Fri, 19 Feb 2010 17:49:59 +0100 (CET) (envelope-from mlfbsd@kanar.ci0.org) Received: (from mlfbsd@localhost) by kanar.ci0.org (8.14.2/8.14.3/Submit) id o1JGnxNC008256; Fri, 19 Feb 2010 17:49:59 +0100 (CET) (envelope-from mlfbsd) Date: Fri, 19 Feb 2010 17:49:59 +0100 From: Olivier Houchard To: ticso@cicely.de Message-ID: <20100219164959.GA8131@ci0.org> References: <20100218131010.GQ50403@deviant.kiev.zoral.com.ua> <20100219031200.GY43625@cicely7.cicely.de> <20100219033000.GZ43625@cicely7.cicely.de> <20100218.204739.680961627231021262.imp@bsdimp.com> <20100219041200.GC43625@cicely7.cicely.de> <20100219120754.GE43625@cicely7.cicely.de> <4B7E840F.2040709@semihalf.com> <20100219162840.GJ43625@cicely7.cicely.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="NzB8fVQJ5HfG6fxh" Content-Disposition: inline In-Reply-To: <20100219162840.GJ43625@cicely7.cicely.de> User-Agent: Mutt/1.4.2.1i X-Mailman-Approved-At: Fri, 19 Feb 2010 17:29:36 +0000 Cc: kostikbel@gmail.com, Grzegorz Bernacki , ticso@cicely7.cicely.de, arm@freebsd.org, current@freebsd.org Subject: Re: bind fails with sig11 on start / pthread failure on ARM? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 16:49:03 -0000 --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > > Strange: Not so much, the first values for ras_start/end were chosen to be immediate values, so you could just mov them, but the new one aren't. Try something like the patch attached instead (untested, I have no arm setup here, but you'll get the idea). Regards, Olivier --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="bind_atomic.h.diff" Index: contrib/bind9/lib/isc/arm/include/isc/atomic.h =================================================================== --- contrib/bind9/lib/isc/arm/include/isc/atomic.h (revision 203777) +++ contrib/bind9/lib/isc/arm/include/isc/atomic.h (working copy) @@ -49,26 +49,22 @@ static inline isc_int32_t isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { - register int done, ras_start; + register int done, ras_start = #0xffff1004; __asm __volatile("1:\n" "adr %1, 1b\n" - "mov %0, #0xe0000004\n" "str %1, [%0]\n" - "mov %0, #0xe0000008\n" "adr %1, 2f\n" - "str %1, [%0]\n" + "str %1, [%0, #4]\n" "ldr %1, [%2]\n" "cmp %1, %3\n" "streq %4, [%2]\n" "2:\n" "mov %3, #0\n" - "mov %0, #0xe0000004\n" "str %3, [%0]\n" "mov %3, #0xffffffff\n" - "mov %0, #0xe0000008\n" - "str %3, [%0]\n" - : "=r" (ras_start), "=r" (done) + "str %3, [%0, #4]\n" + : "+r" (ras_start), "=r" (done) ,"+r" (p), "+r" (cmpval), "+r" (val) : : "memory"); return (done); --NzB8fVQJ5HfG6fxh--