From andrewm@isoar.ca Thu Mar 13 16:13:02 2003
Return-path: <andrewm@isoar.ca>
Envelope-to: ralphs@netwinder.org
Delivery-date: Thu, 13 Mar 2003 16:13:02 -0500
Received: from andrewm.dsl.istop.com
	([66.11.173.24] helo=martika.isoar.ca ident=[5NBdxfRepjBzMWvRRwHArn3W+PPZCvT8])
	by netwinder.org with esmtp (Exim 3.22 #1)
	id 18ta0c-0005bX-00
	for ralphs@netwinder.org; Thu, 13 Mar 2003 16:13:02 -0500
Received: from isoar.ca (vpn.blueairnetworks.com [209.202.115.18])
	(authenticated bits=0)
	by martika.isoar.ca (8.12.8/8.12.5) with ESMTP id h2DLCqgw031743
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO)
	for <ralphs@netwinder.org>; Thu, 13 Mar 2003 16:13:00 -0500
Message-ID: <3E70F450.40000@isoar.ca>
Date: Thu, 13 Mar 2003 16:12:48 -0500
From: "Andrew E. Mileski" <andrewm@isoar.ca>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030210
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Ralph Siemsen <ralphs@netwinder.org>
Subject: [Fwd: Re: PATCH: Atomic mutex for ARM [#5018]]
Content-Type: multipart/mixed;
 boundary="------------050502080906080903070000"
Status: RO
Content-Length: 2937
Lines: 103

This is a multi-part message in MIME format.
--------------050502080906080903070000
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit


-- 
Andrew E. Mileski
Ottawa, Canada
http://isoar.ca/

--------------050502080906080903070000
Content-Type: message/rfc822;
 name="Re: PATCH: Atomic mutex for ARM [#5018]"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="Re: PATCH: Atomic mutex for ARM [#5018]"

Message-ID: <3E53DFCB.1060208@isoar.ca>
Date: Wed, 19 Feb 2003 14:49:31 -0500
From: "Andrew E. Mileski" <andrewm@isoar.ca>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030210
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Keith Bostic <bostic@abyssinian.sleepycat.com>
Subject: Re: PATCH: Atomic mutex for ARM [#5018]
References: <200302191710.h1JHAIN0037740@abyssinian.sleepycat.com>
In-Reply-To: <200302191710.h1JHAIN0037740@abyssinian.sleepycat.com>
Content-Type: multipart/mixed;
 boundary="------------000403080509070109090106"

This is a multi-part message in MIME format.
--------------000403080509070109090106
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Keith Bostic wrote:
>>Recently I bitched to a colleague that the patch hadn't made it
>>into the mainline yet :)
> 
> Our mainline releases?  This change has been in our releases
> ever since you sent it to us, I believe.

Sorry,  The blame is Red Hat's.  They are still shipping 4.0.14.

> I'm concerned about the major change to MUTEX_UNSET -- why is
> that additional work needed?

Since I din't have the same source base as you, it was easier to
copy and paste 10 lines in the editor than type out 1 line <:)

> Our current code is as follows.  Do we really need the change
> to MUTEX_UNSET?

No.

> Can you send me a diff against the current code?

Attached.

> And, would you be able to run our mutex test code against a
> current Berkeley DB snapshot?  If so, please let me know and
> I'll point you to a snapshot and instructions for running the
> mutex test.

Sure.

-- 
Andrew E. Mileski
Ottawa, Canada
http://isoar.ca/

--------------000403080509070109090106
Content-Type: text/plain;
 name="db-4.1.25-arm.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="db-4.1.25-arm.patch"

--- db-4.1.25/dbinc/mutex.h.orig	2003-02-19 14:33:05.000000000 -0500
+++ db-4.1.25/dbinc/mutex.h	2003-02-19 14:37:17.000000000 -0500
@@ -398,10 +398,11 @@
  */
 #define	MUTEX_SET(tsl) ({						\
 	int __r;							\
-	asm volatile("swpb %0, %1, [%2]"				\
-	    : "=r" (__r) 						\
-	    : "0" (1), "r" (tsl)					\
-	    : "memory"							\
+	asm volatile(							\
+		"swpb	%0, %1, [%2]\n\t"				\
+		"eor	%0, %0, #1\n\t"					\
+	    : "=&r" (__r) 						\
+	    : "r" (1), "r" (tsl)					\
 	    );								\
 	__r & 1;							\
 })

--------------000403080509070109090106--


--------------050502080906080903070000--



