All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] powerpc/64: implement spin loop primitives
@ 2017-06-28 12:13 Michael Ellerman
  2017-06-28 12:13 ` [PATCH 2/2] powerpc: use spin loop primitives in some functions Michael Ellerman
  2017-07-02 11:01 ` [1/2] powerpc/64: implement spin loop primitives Michael Ellerman
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Ellerman @ 2017-06-28 12:13 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: npiggin

From: Nicholas Piggin <npiggin@gmail.com>

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/include/asm/processor.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index c49165a7439c..832775771bd3 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -428,6 +428,26 @@ static inline unsigned long __pack_fe01(unsigned int fpmode)
 
 #ifdef CONFIG_PPC64
 #define cpu_relax()	do { HMT_low(); HMT_medium(); barrier(); } while (0)
+
+#define spin_begin()	HMT_low()
+
+#define spin_cpu_relax()	barrier()
+
+#define spin_cpu_yield()	spin_cpu_relax()
+
+#define spin_end()	HMT_medium()
+
+#define spin_until_cond(cond)					\
+do {								\
+	if (unlikely(!(cond))) {				\
+		spin_begin();					\
+		do {						\
+			spin_cpu_relax();			\
+		} while (!(cond));				\
+		spin_end();					\
+	}							\
+} while (0)
+
 #else
 #define cpu_relax()	barrier()
 #endif
-- 
2.7.4

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

end of thread, other threads:[~2017-07-13 10:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-28 12:13 [PATCH 1/2] powerpc/64: implement spin loop primitives Michael Ellerman
2017-06-28 12:13 ` [PATCH 2/2] powerpc: use spin loop primitives in some functions Michael Ellerman
2017-07-02  9:30   ` kbuild test robot
2017-07-02 15:42     ` issue with kernel 4.12.rc6 addnote -kernel dont build luigi burdo
2017-07-10 11:01       ` Michael Ellerman
2017-07-13 10:09         ` luigi burdo
2017-07-02 11:01 ` [1/2] powerpc/64: implement spin loop primitives Michael Ellerman

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.