From owner-freebsd-hackers Wed Nov 21 11:39: 2 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail11.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by hub.freebsd.org (Postfix) with ESMTP id 7EFD337B419 for ; Wed, 21 Nov 2001 11:38:36 -0800 (PST) Received: (qmail 13297 invoked from network); 21 Nov 2001 19:38:42 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 21 Nov 2001 19:38:42 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <00e701c17264$a4617130$ef01a8c0@davidwnt> Date: Wed, 21 Nov 2001 11:38:35 -0800 (PST) From: John Baldwin To: David Xu Subject: RE: add some constraints in cpufunc.h Cc: freebsd-hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 21-Nov-01 David Xu wrote: > 4.4-stable, file sys/i386/include/cpufunc.h, > > --- cpufunc.h.orig Wed Nov 21 13:35:36 2001 > +++ cpufunc.h Wed Nov 21 15:00:12 2001 > @@ -72,7 +72,7 @@ > { > u_int result; > > - __asm __volatile("bsfl %0,%0" : "=r" (result) : "0" (mask)); > + __asm __volatile("bsfl %0,%0" : "=r" (result) : "0" (mask) : "cc"); > return (result); > } > > @@ -81,7 +81,7 @@ > { > u_int result; > > - __asm __volatile("bsrl %0,%0" : "=r" (result) : "0" (mask)); > + __asm __volatile("bsrl %0,%0" : "=r" (result) : "0" (mask) : "cc"); > return (result); > } > > @@ -305,7 +305,7 @@ > u_int result; > > __asm __volatile("xorl %0,%0; xchgl %1,%0" > - : "=&r" (result) : "m" (*addr)); > + : "=&r" (result) : "m" (*addr) : "cc"); > return (result); > } > Have you had actual bugs as a result of "cc" not being in the constraints? If so, there's a _lot_ more places that need this. All the atomic ops, for example. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message