From owner-freebsd-alpha@FreeBSD.ORG Thu Aug 7 13:21:22 2003 Return-Path: Delivered-To: freebsd-alpha@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 52CDD37B401; Thu, 7 Aug 2003 13:21:22 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id A2BE843F93; Thu, 7 Aug 2003 13:21:21 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h77KLKuN015250; Thu, 7 Aug 2003 16:21:20 -0400 (EDT) Date: Thu, 7 Aug 2003 16:21:20 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Marcel Moolenaar In-Reply-To: <20030807195504.GA837@athlon.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: deischen@freebsd.org cc: "Portante, Peter" cc: alpha@freebsd.org Subject: Re: Atomic swap X-BeenThere: freebsd-alpha@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Porting FreeBSD to the Alpha List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2003 20:21:22 -0000 On Thu, 7 Aug 2003, Marcel Moolenaar wrote: > On Thu, Aug 07, 2003 at 03:31:55PM -0400, Daniel Eischen wrote: > > > > > " stq t0,%3\n" > > > ^^^^^^^^^^^^^^^^^^^^ > > > > > > Whoops, typo: %3 should be %2. > > > > Yup, I caught that but didn't want to complain when something > > is handed to me on a silver platter ;-) > > As long as you saw it :-) BTW, this is the only way I got it to compile. The compiler (or assembler) didn't seem to like having t0 and t1 hardcoded. Grr, I just remembered. t0, t1, etc are our names for them. They should probably be $1 and $2. static __inline void atomic_swap_long(volatile long *dst, long val, long *res) { long temp1, temp2; __asm ( "1: ldq_l %3, %1\n" " mov %2, %4\n" " stq_c %4, %1\n" " beq %4, 1b\n" " stq %3, %0\n" : "=m"(*res) : "m"(*dst), "r"(val), "r"(temp1), "r"(temp2) : "memory"); } -- Dan Eischen