diff -Naur --exclude='*.orig' --exclude='*.rej' linux-2.6.11.3/include/asm-i386/system.h linux-2.6.11.3~patched/include/asm-i386/system.h --- linux-2.6.11.3/include/asm-i386/system.h 2005-03-13 08:43:59.000000000 +0200 +++ linux-2.6.11.3~patched/include/asm-i386/system.h 2005-03-13 21:43:22.291192568 +0200 @@ -244,26 +244,26 @@ #endif static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, - unsigned long new, int size) + unsigned long _new, int size) { unsigned long prev; switch (size) { case 1: __asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2" : "=a"(prev) - : "q"(new), "m"(*__xg(ptr)), "0"(old) + : "q"(_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) + : "q"(_new), "m"(*__xg(ptr)), "0"(old) : "memory"); return prev; case 4: __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2" : "=a"(prev) - : "q"(new), "m"(*__xg(ptr)), "0"(old) + : "q"(_new), "m"(*__xg(ptr)), "0"(old) : "memory"); return prev; } diff -Naur --exclude='*.orig' --exclude='*.rej' linux-2.6.11.3/include/asm-x86_64/system.h linux-2.6.11.3~patched/include/asm-x86_64/system.h --- linux-2.6.11.3/include/asm-x86_64/system.h 2005-03-13 08:44:38.000000000 +0200 +++ linux-2.6.11.3~patched/include/asm-x86_64/system.h 2005-03-13 21:46:19.052320792 +0200 @@ -4,6 +4,32 @@ #include #include #include +#include /* for LOCK_PREFIX... */ + +/* + * Alternative inline assembly with input. + * + * Pecularities: + * No memory clobber here. + * Argument numbers start with 1. + * Best is to use constraints that are fixed size (like (%1) ... "r") + * If you use variable sized constraints like "m" or "g" in the + * replacement maake sure to pad to the worst case length. + */ + +#define alternative_input(oldinstr, newinstr, feature, input) \ + asm volatile ("661:\n\t" oldinstr "\n662:\n" \ + ".section .altinstructions,\"a\"\n" \ + " .align 8\n" \ + " .quad 661b\n" /* label */ \ + " .quad 663f\n" /* new instruction */ \ + " .byte %c0\n" /* feature bit */ \ + " .byte 662b-661b\n" /* sourcelen */ \ + " .byte 664f-663f\n" /* replacementlen */ \ + ".previous\n" \ + ".section .altinstr_replacement,\"ax\"\n" \ + "663:\n\t" newinstr "\n664:\n" /* replacement */ \ + ".previous" :: "i" (feature), input) #ifdef __KERNEL__ @@ -114,30 +140,6 @@ ".previous" :: "i" (feature) : "memory") /* - * Alternative inline assembly with input. - * - * Pecularities: - * No memory clobber here. - * Argument numbers start with 1. - * Best is to use constraints that are fixed size (like (%1) ... "r") - * If you use variable sized constraints like "m" or "g" in the - * replacement maake sure to pad to the worst case length. - */ -#define alternative_input(oldinstr, newinstr, feature, input...) \ - asm volatile ("661:\n\t" oldinstr "\n662:\n" \ - ".section .altinstructions,\"a\"\n" \ - " .align 8\n" \ - " .quad 661b\n" /* label */ \ - " .quad 663f\n" /* new instruction */ \ - " .byte %c0\n" /* feature bit */ \ - " .byte 662b-661b\n" /* sourcelen */ \ - " .byte 664f-663f\n" /* replacementlen */ \ - ".previous\n" \ - ".section .altinstr_replacement,\"ax\"\n" \ - "663:\n\t" newinstr "\n664:\n" /* replacement */ \ - ".previous" :: "i" (feature), ##input) - -/* * Clear and set 'TS' bit respectively */ #define clts() __asm__ __volatile__ ("clts")