public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Willy Tarreau <w@1wt.eu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.4.x: i386/x86_64 bitops clobberings
Date: Mon, 09 Oct 2006 08:27:54 +0200	[thread overview]
Message-ID: <4529EBEA.4070602@web.de> (raw)
In-Reply-To: <20061008233617.GA30255@1wt.eu>

[-- Attachment #1: Type: text/plain, Size: 1176 bytes --]

Willy Tarreau wrote:
> I've done it too, but unfortunately, I discovered that it does not build
> with gcc-2.95 anymore, while 3.3 is fine :
> 
> cyclades.c: In function `cyy_interrupt':
> /usr/src/git/linux-2.4/include/asm/bitops.h:130: inconsistent operand constraints in an `asm'
> cyclades.c: In function `cyz_handle_rx':
> /usr/src/git/linux-2.4/include/asm/bitops.h:130: inconsistent operand constraints in an `asm'
> 
> 127        __asm__ __volatile__( LOCK_PREFIX
> 128                "btsl %2,%1\n\tsbbl %0,%0"
> 129                :"=r" (oldbit),"+m" (ADDR)
> 130                :"Ir" (nr) : "memory");
> 
> 
> I don't know what the right solution should be. I'm not fond of #ifdefs,
> and I'm embarrassed to know that gcc can do all sorts of nasty things due
> to a wrong clobbering :-/
> 
> If you have any idea on the subject, I'm willing to try.

What about

#if __GNUC__ < 3
#define ADDR_DEPS "=m"
#else
#define ADDR_DEPS "+m"
#endif

	__asm__ __volatile__( LOCK_PREFIX
		"btsl %2,%1\n\tsbbl %0,%0"
		:"=r" (oldbit),ADDR_DEPS (ADDR)
		:"Ir" (nr) : "memory");

or something similar? Would keep the number of #ifs low.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

  reply	other threads:[~2006-10-09  6:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-08 21:42 2.4.x: i386/x86_64 bitops clobberings Jan Kiszka
2006-10-08 22:44 ` Willy Tarreau
2006-10-08 22:53   ` Jan Kiszka
2006-10-08 23:36     ` Willy Tarreau
2006-10-09  6:27       ` Jan Kiszka [this message]
2006-10-14 19:50         ` Willy Tarreau
2006-10-15  9:56           ` Jan Kiszka
2006-10-15 10:12             ` Willy Tarreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4529EBEA.4070602@web.de \
    --to=jan.kiszka@web.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox