readq/writeq bust?
Benjamin Herrenschmidt
benh at kernel.crashing.org
Wed May 19 15:55:46 EST 2004
On Tue, 2004-05-18 at 00:46, Anton Blanchard wrote:
> Hi,
>
> I had to back the fix out of the s2io driver so it wouldnt use our
> readq/writeq macros. Are they bust?
Yes, they are bust. Here's a patch:
===== include/asm-ppc64/io.h 1.17 vs edited =====
--- 1.17/include/asm-ppc64/io.h Sat May 15 12:00:27 2004
+++ edited/include/asm-ppc64/io.h Wed May 19 15:54:42 2004
@@ -326,7 +326,7 @@
"rldicl %1,%1,32,0\n"
"rlwimi %0,%1,8,8,31\n"
"rlwimi %0,%1,24,16,23\n"
- : "=r" (ret), "=r" (tmp) : "b" (addr) , "m" (*addr));
+ : "=&r" (ret) , "=r" (tmp) : "b" (addr) , "m" (*addr));
return ret;
}
@@ -339,7 +339,7 @@
return ret;
}
-static inline void out_le64(volatile unsigned long *addr, int val)
+static inline void out_le64(volatile unsigned long *addr, unsigned long val)
{
unsigned long tmp;
@@ -351,9 +351,9 @@
"rldicl %1,%1,32,0\n"
"rlwimi %0,%1,8,8,31\n"
"rlwimi %0,%1,24,16,23\n"
- "std %0,0(%2)\n"
+ "std %0,0(%3)\n"
"sync"
- : "=r" (tmp) : "r" (val), "b" (addr) , "m" (*addr));
+ : "=&r" (tmp) , "=r" (val) : "1" (val) , "b" (addr) , "m" (*addr));
}
static inline void out_be64(volatile unsigned long *addr, int val)
** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc64-dev
mailing list