public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix ppc64 out_be64
@ 2004-06-12 22:00 Roland Dreier
  2004-06-13 15:50 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 8+ messages in thread
From: Roland Dreier @ 2004-06-12 22:00 UTC (permalink / raw)
  To: anton, linuxppc64-dev, linux-kernel

I notice that the latest BK has a fix for the bugs in ppc64's out_le64
that I just spent a few hours tracking down in 2.6.6, but out_be64 is
still broken.

This patch fixes two problems with out_be64:
 - The val parameter has to be unsigned long (not int), since it's 64 bits.
 - Since we're passing *addr into the asm as an output parameter, we
   should just use %0 instead of 0(%0) -- what's written won't even
   compile.

My ppc64 asm skills are nearly nonexistent but I'm pretty sure this
fix is needed and correct.

Thanks,
  Roland

Signed-off-by: Roland Dreier <roland@topspin.com>

===== include/asm-ppc64/io.h 1.18 vs edited =====
--- 1.18/include/asm-ppc64/io.h	2004-05-21 00:50:11 -07:00
+++ edited/include/asm-ppc64/io.h	2004-06-12 14:55:49 -07:00
@@ -356,9 +356,9 @@
 			     : "=&r" (tmp) , "=&r" (val) : "1" (val) , "b" (addr) , "m" (*addr));
 }
 
-static inline void out_be64(volatile unsigned long *addr, int val)
+static inline void out_be64(volatile unsigned long *addr, unsigned long val)
 {
-	__asm__ __volatile__("std %1,0(%0); sync" : "=m" (*addr) : "r" (val));
+	__asm__ __volatile__("std %1,%0; sync" : "=m" (*addr) : "r" (val));
 }
 
 #ifndef CONFIG_PPC_ISERIES 

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

end of thread, other threads:[~2004-06-14 21:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-12 22:00 [PATCH] Fix ppc64 out_be64 Roland Dreier
2004-06-13 15:50 ` Benjamin Herrenschmidt
2004-06-13 16:21   ` Anton Blanchard
2004-06-13 17:08     ` Benjamin Herrenschmidt
2004-06-13 16:48   ` Roland Dreier
2004-06-13 17:11     ` Benjamin Herrenschmidt
2004-06-14 20:26       ` Roland Dreier
2004-06-14 21:10         ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox