From owner-freebsd-current Sat Nov 10 14:22:57 2001 Delivered-To: freebsd-current@freebsd.org Received: from smtp016.mail.yahoo.com (smtp016.mail.yahoo.com [216.136.174.113]) by hub.freebsd.org (Postfix) with SMTP id 5BD7637B419 for ; Sat, 10 Nov 2001 14:22:50 -0800 (PST) Received: from mkc-65-30-96-67.kc.rr.com (HELO yahoo.com) (65.30.96.67) by smtp.mail.vip.sc5.yahoo.com with SMTP; 10 Nov 2001 22:22:49 -0000 X-Apparently-From: Message-ID: <3BEDA8A8.7060500@yahoo.com> Date: Sat, 10 Nov 2001 16:22:32 -0600 From: Jim Bryant Reply-To: kc5vdj@yahoo.com User-Agent: Mozilla/5.0 (X11; U; Linux i386; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1 X-Accept-Language: en-us MIME-Version: 1.0 To: John Baldwin Cc: Bruce Evans , current@FreeBSD.ORG Subject: Re: kernel won't build - atomic.c/atomic.h errors... References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I'll give it a try next time I build a kernel. Thanks for the info on the optimization option info, adding -O was successful in compiling atomic.c. John Baldwin wrote: > On 08-Nov-01 Bruce Evans wrote: > >>On Fri, 2 Nov 2001, Jim Bryant wrote: >> >> >>>Is anyone else seeing this problem? I posted a message the other day to >>>this list, and have yet to see a single response. >>> >>>This is from a completely fresh cvsup of everything. >>> >>>buildworld succeeds, but the kernel build fails on atomic.c with the >>>following message about the ATOMIC_ASM macros in atomic.h. >>> >>>The archetecture is 5.0-really-current on an SMP P2-333 machine. >>> >>>the message seems to be: "inconsistent operand constraints in an `asm'" >>> >>Only people who have clobbered -O in CFLAGS in /etc/make.conf should see >>this problem :-). >> >>The i386 still uses archaic constraints for some >>input-output operands ("0" for the first operand). These never worked >>right and if fact don't actually work for compiling this file without >>optimization. >> > > Hmm, would you prefer this diff then, I've had it floating around for a while > now but wasn't sure it was right: > > --- //depot/vendor/freebsd/sys/i386/include/atomic.h 2001/10/08 14:41:47 > +++ //depot/projects/smpng/sys/i386/include/atomic.h 2001/10/08 22:37:17 > @@ -99,8 +99,8 @@ > atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ > { \ > __asm __volatile(MPLOCKED OP \ > - : "=m" (*p) \ > - : "0" (*p), "ir" (V)); \ > + : "+m" (*p) \ > + : "ir" (V)); \ > } > > /* > @@ -211,25 +211,25 @@ > #endif /* KLD_MODULE */ > > #if !defined(LOCORE) > -ATOMIC_ASM(set, char, "orb %b2,%0", v) > -ATOMIC_ASM(clear, char, "andb %b2,%0", ~v) > -ATOMIC_ASM(add, char, "addb %b2,%0", v) > -ATOMIC_ASM(subtract, char, "subb %b2,%0", v) > +ATOMIC_ASM(set, char, "orb %b1,%0", v) > +ATOMIC_ASM(clear, char, "andb %b1,%0", ~v) > +ATOMIC_ASM(add, char, "addb %b1,%0", v) > +ATOMIC_ASM(subtract, char, "subb %b1,%0", v) > > -ATOMIC_ASM(set, short, "orw %w2,%0", v) > -ATOMIC_ASM(clear, short, "andw %w2,%0", ~v) > -ATOMIC_ASM(add, short, "addw %w2,%0", v) > -ATOMIC_ASM(subtract, short, "subw %w2,%0", v) > +ATOMIC_ASM(set, short, "orw %w1,%0", v) > +ATOMIC_ASM(clear, short, "andw %w1,%0", ~v) > +ATOMIC_ASM(add, short, "addw %w1,%0", v) > +ATOMIC_ASM(subtract, short, "subw %w1,%0", v) > > -ATOMIC_ASM(set, int, "orl %2,%0", v) > -ATOMIC_ASM(clear, int, "andl %2,%0", ~v) > -ATOMIC_ASM(add, int, "addl %2,%0", v) > -ATOMIC_ASM(subtract, int, "subl %2,%0", v) > +ATOMIC_ASM(set, int, "orl %1,%0", v) > +ATOMIC_ASM(clear, int, "andl %1,%0", ~v) > +ATOMIC_ASM(add, int, "addl %1,%0", v) > +ATOMIC_ASM(subtract, int, "subl %1,%0", v) > > -ATOMIC_ASM(set, long, "orl %2,%0", v) > -ATOMIC_ASM(clear, long, "andl %2,%0", ~v) > -ATOMIC_ASM(add, long, "addl %2,%0", v) > -ATOMIC_ASM(subtract, long, "subl %2,%0", v) > +ATOMIC_ASM(set, long, "orl %1,%0", v) > +ATOMIC_ASM(clear, long, "andl %1,%0", ~v) > +ATOMIC_ASM(add, long, "addl %1,%0", v) > +ATOMIC_ASM(subtract, long, "subl %1,%0", v) > > ATOMIC_STORE_LOAD(char, "cmpxchgb %b0,%1", "xchgb %b1,%0") > ATOMIC_STORE_LOAD(short,"cmpxchgw %w0,%1", "xchgw %w1,%0") > > jim -- ET has one helluva sense of humor! He's always anal-probing right-wing schizos! ----------------------------------------------------- POWER TO THE PEOPLE! ----------------------------------------------------- "Religious fundamentalism is the biggest threat to international security that exists today." United Nations Secretary General B.B.Ghali, 1995 _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message