From owner-svn-src-all@FreeBSD.ORG Sat Jun 13 18:10:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 041E71065677; Sat, 13 Jun 2009 18:10:40 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id A20D98FC1E; Sat, 13 Jun 2009 18:10:34 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 55D062C2A81; Sat, 13 Jun 2009 13:10:34 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id UQXcct0mjPYr; Sat, 13 Jun 2009 13:10:26 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 81DDE2C2A7E; Sat, 13 Jun 2009 13:10:26 -0500 (CDT) Message-ID: <4A33EB91.2000605@cs.rice.edu> Date: Sat, 13 Jun 2009 13:10:25 -0500 From: Alan Cox User-Agent: Thunderbird 2.0.0.21 (X11/20090404) MIME-Version: 1.0 To: Ed Schouten References: <200906131356.n5DDu6bT015673@svn.freebsd.org> In-Reply-To: <200906131356.n5DDu6bT015673@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194110 - head/sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 18:10:40 -0000 Ed Schouten wrote: > Author: ed > Date: Sat Jun 13 13:56:06 2009 > New Revision: 194110 > URL: http://svn.freebsd.org/changeset/base/194110 > > Log: > Simplify the inline assembler (and correct potential error) of pte_load_store(). > > Submitted by: Christoph Mallon > > Modified: > head/sys/i386/include/pmap.h > > Modified: head/sys/i386/include/pmap.h > ============================================================================== > --- head/sys/i386/include/pmap.h Sat Jun 13 13:54:03 2009 (r194109) > +++ head/sys/i386/include/pmap.h Sat Jun 13 13:56:06 2009 (r194110) > @@ -362,15 +362,8 @@ pte_load(pt_entry_t *ptep) > static __inline pt_entry_t > pte_load_store(pt_entry_t *ptep, pt_entry_t pte) > { > - pt_entry_t r; > - > - __asm __volatile( > - "xchgl %0,%1" > - : "=m" (*ptep), > - "=r" (r) > - : "1" (pte), > - "m" (*ptep)); > - return (r); > + __asm volatile("xchgl %0, %1" : "+m" (*ptep), "+r" (pte)); > + return (pte); > } > > #define pte_load_clear(pte) atomic_readandclear_int(pte) > I'm afraid that this change violates the rules, specifically, "+" cannot be combined with "m": File: gcc.info, Node: Extended Asm, Next: Constraints, Prev: Inline, Up: C Extensions 5.35 Assembler Instructions with C Expression Operands ====================================================== ... Extended asm supports input-output or read-write operands. Use the constraint character `+' to indicate such an operand and list it with the output operands. You should only use read-write operands when the constraints for the operand (or the operand in which only some of the bits are to be changed) allow a register.