All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [parisc-linux] Just A suggestion to highlight mb() and cpu_relax() in s files?
@ 2006-08-25 12:39 Joel Soete
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Soete @ 2006-08-25 12:39 UTC (permalink / raw)
  To: kyle; +Cc: parisc-linux, matthew

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

> On Thu, Aug 24, 2006 at 09:47:21AM -0600, Matthew Wilcox wrote:
> > I like the idea.  How about using the function name instead, though?
> >
> > +#define __mb(s)           __asm__ __volatile__(s "()":::"memory") /*
barrier() */
> > +#define mb()	__mb("mb")
> > +#define rmb()          __mb("rmb")
> > +#define wmb()          __mb("wmb")
> > +#define smp_mb()       __mb("smp_mb")
>
> I liek it.
>
--- include/asm-parisc/system.h.Orig    2006-08-24 08:43:12.000000000 +0200
+++ include/asm-parisc/system.h 2006-08-25 12:05:51.000000000 +0200
@@ -141,12 +141,13 @@
 ** The __asm__ op below simple prevents gcc/ld from reordering
 ** instructions across the mb() "call".
 */
-#define mb()           __asm__ __volatile__("":::"memory")     /* barrier() */
-#define rmb()          mb()
-#define wmb()          mb()
-#define smp_mb()       mb()
-#define smp_rmb()      mb()
-#define smp_wmb()      mb()
+#define __mb(s)                __asm__ __volatile__("# " s "()":::"memory")
  /* barrier() */
+#define mb()           __mb("mb")
+#define rmb()          __mb("rmb")
+#define wmb()          __mb("wmb")
+#define smp_mb()       __mb("smp_mb")
+#define smp_rmb()      __mb("smp_rmb")
+#define smp_wmb()      __mb("smp_wmb")
 #define smp_read_barrier_depends()     do { } while(0)
 #define read_barrier_depends()         do { } while(0)

--- include/asm-parisc/processor.h.Orig 2006-08-24 08:47:36.000000000 +0200
+++ include/asm-parisc/processor.h      2006-08-25 11:07:28.000000000 +0200
@@ -330,7 +330,7 @@
 #define KSTK_EIP(tsk)  ((tsk)->thread.regs.iaoq[0])
 #define KSTK_ESP(tsk)  ((tsk)->thread.regs.gr[30])

-#define cpu_relax()    barrier()
+#define cpu_relax()    __mb("cpu_relax")

 #endif /* __ASSEMBLY__ */

==== <> ====

(also attached in case of bad wraping ;-)

Cheers,
    Joel

----------
Club Scarlet : Tout le monde gagne! Si vous devenez aujourd'hui Scarlet One grace a un client existant de Scarlet, vous recevez tous les deux un cadeau d'une valeur de 50 euros! Surfez vite sur http://www.clubscarlet.be

[-- Attachment #2: MbComment.txt --]
[-- Type: text/plain, Size: 1225 bytes --]

--- include/asm-parisc/system.h.Orig	2006-08-24 08:43:12.000000000 +0200
+++ include/asm-parisc/system.h	2006-08-25 12:05:51.000000000 +0200
@@ -141,12 +141,13 @@
 ** The __asm__ op below simple prevents gcc/ld from reordering
 ** instructions across the mb() "call".
 */
-#define mb()		__asm__ __volatile__("":::"memory")	/* barrier() */
-#define rmb()		mb()
-#define wmb()		mb()
-#define smp_mb()	mb()
-#define smp_rmb()	mb()
-#define smp_wmb()	mb()
+#define __mb(s)		__asm__ __volatile__("# " s "()":::"memory")	/* barrier() */
+#define mb()		__mb("mb")
+#define rmb()		__mb("rmb")
+#define wmb()		__mb("wmb")
+#define smp_mb()	__mb("smp_mb")
+#define smp_rmb()	__mb("smp_rmb")
+#define smp_wmb()	__mb("smp_wmb")
 #define smp_read_barrier_depends()	do { } while(0)
 #define read_barrier_depends()		do { } while(0)
 
--- include/asm-parisc/processor.h.Orig	2006-08-24 08:47:36.000000000 +0200
+++ include/asm-parisc/processor.h	2006-08-25 11:07:28.000000000 +0200
@@ -330,7 +330,7 @@
 #define KSTK_EIP(tsk)	((tsk)->thread.regs.iaoq[0])
 #define KSTK_ESP(tsk)	((tsk)->thread.regs.gr[30])
 
-#define cpu_relax()	barrier()
+#define cpu_relax()	__mb("cpu_relax")
 
 #endif /* __ASSEMBLY__ */
 

[-- Attachment #3: Type: text/plain, Size: 169 bytes --]

_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

end of thread, other threads:[~2006-08-25 12:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <J4IE0Y$F96BD8695898C37EEF35C0BA6880F173@scarlet.be>
     [not found] ` <20060824154721.GL24068@parisc-linux.org>
     [not found]   ` <20060824161532.GA1455@athena.road.mcmartin.ca>
2006-08-24 18:39     ` [parisc-linux] Just A suggestion to highlight mb() and cpu_relax() in s files? Joel Soete
2006-08-25 12:39 Joel Soete

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.