All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86-64 cmpxchg adjustment
@ 2005-09-08 16:03 Jan Beulich
  2005-09-09  8:57 ` [discuss] " Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2005-09-08 16:03 UTC (permalink / raw)
  To: Andreas Kleen; +Cc: linux-kernel, discuss

[-- 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;
 	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [discuss] [PATCH] x86-64 cmpxchg adjustment
  2005-09-08 16:03 [PATCH] x86-64 cmpxchg adjustment Jan Beulich
@ 2005-09-09  8:57 ` Andi Kleen
  2005-09-09  9:17   ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2005-09-09  8:57 UTC (permalink / raw)
  To: discuss; +Cc: Jan Beulich, linux-kernel

On Thursday 08 September 2005 18:03, Jan Beulich wrote:
> (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.

Attachment is empty.

-Andi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [discuss] [PATCH] x86-64 cmpxchg adjustment
  2005-09-09  8:57 ` [discuss] " Andi Kleen
@ 2005-09-09  9:17   ` Jan Beulich
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2005-09-09  9:17 UTC (permalink / raw)
  To: Andi Kleen, discuss; +Cc: linux-kernel

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

>>> Andi Kleen <ak@suse.de> 09.09.05 10:57:07 >>>
>On Thursday 08 September 2005 18:03, Jan Beulich wrote:
>> (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.
>
>Attachment is empty.

Strange - maybe another of these neat GroupWise problems...

[-- 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;
 	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-09-09  9:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-08 16:03 [PATCH] x86-64 cmpxchg adjustment Jan Beulich
2005-09-09  8:57 ` [discuss] " Andi Kleen
2005-09-09  9:17   ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.