From: "Jan Beulich" <JBeulich@novell.com>
To: "Andreas Kleen" <ak@suse.de>
Cc: <linux-kernel@vger.kernel.org>, <discuss@x86-64.org>
Subject: [PATCH] x86-64 cmpxchg adjustment
Date: Thu, 08 Sep 2005 18:03:22 +0200 [thread overview]
Message-ID: <43207CEA020000780002451A@emea1-mh.id2.novell.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]
(Note: Patch also attached because the inline version is certain to get
line wrapped.)
While only cosmetic for x86-64, this adjusts the cmpxchg code
appearantly
inherited from i386 to use more generic constraints.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
diff -Npru 2.6.13/include/asm-x86_64/system.h
2.6.13-x86_64-cmpxchg/include/asm-x86_64/system.h
--- 2.6.13/include/asm-x86_64/system.h 2005-08-29 01:41:01.000000000
+0200
+++ 2.6.13-x86_64-cmpxchg/include/asm-x86_64/system.h 2005-09-01
11:32:12.000000000 +0200
@@ -247,25 +247,25 @@ static inline unsigned long __cmpxchg(vo
case 1:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
: "=a"(prev)
- : "q"(new), "m"(*__xg(ptr)),
"0"(old)
+ : "r"(new), "m"(*__xg(ptr)),
"0"(old)
: "memory");
return prev;
case 2:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
: "=a"(prev)
- : "q"(new), "m"(*__xg(ptr)),
"0"(old)
+ : "r"(new), "m"(*__xg(ptr)),
"0"(old)
: "memory");
return prev;
case 4:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %k1,%2"
: "=a"(prev)
- : "q"(new), "m"(*__xg(ptr)),
"0"(old)
+ : "r"(new), "m"(*__xg(ptr)),
"0"(old)
: "memory");
return prev;
case 8:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgq %1,%2"
: "=a"(prev)
- : "q"(new), "m"(*__xg(ptr)),
"0"(old)
+ : "r"(new), "m"(*__xg(ptr)),
"0"(old)
: "memory");
return prev;
}
[-- Attachment #2: linux-2.6.13-x86_64-cmpxchg.patch --]
[-- Type: application/octet-stream, Size: 1481 bytes --]
(Note: Patch also attached because the inline version is certain to get
line wrapped.)
While only cosmetic for x86-64, this adjusts the cmpxchg code appearantly
inherited from i386 to use more generic constraints.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
diff -Npru 2.6.13/include/asm-x86_64/system.h 2.6.13-x86_64-cmpxchg/include/asm-x86_64/system.h
--- 2.6.13/include/asm-x86_64/system.h 2005-08-29 01:41:01.000000000 +0200
+++ 2.6.13-x86_64-cmpxchg/include/asm-x86_64/system.h 2005-09-01 11:32:12.000000000 +0200
@@ -247,25 +247,25 @@ static inline unsigned long __cmpxchg(vo
case 1:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
: "=a"(prev)
- : "q"(new), "m"(*__xg(ptr)), "0"(old)
+ : "r"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
case 2:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
: "=a"(prev)
- : "q"(new), "m"(*__xg(ptr)), "0"(old)
+ : "r"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
case 4:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %k1,%2"
: "=a"(prev)
- : "q"(new), "m"(*__xg(ptr)), "0"(old)
+ : "r"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
case 8:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgq %1,%2"
: "=a"(prev)
- : "q"(new), "m"(*__xg(ptr)), "0"(old)
+ : "r"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
}
next reply other threads:[~2005-09-08 16:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-08 16:03 Jan Beulich [this message]
2005-09-09 8:57 ` [discuss] " Andi Kleen
2005-09-09 9:17 ` Jan Beulich
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=43207CEA020000780002451A@emea1-mh.id2.novell.com \
--to=jbeulich@novell.com \
--cc=ak@suse.de \
--cc=discuss@x86-64.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®