public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/9] x86-64 untangle smp.h vs thread_info
@ 2005-11-30  4:21 Benjamin LaHaise
  0 siblings, 0 replies; only message in thread
From: Benjamin LaHaise @ 2005-11-30  4:21 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

Similar to the include dependancy in seccomp.h, an inline function in
smp.h introduces messy ordering requirements on thread_info by way of
using an inline function instead of macro.  Convert on_each_cpu to a
macro in order to avoid a big include mess.

---

 include/linux/smp.h |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

applies-to: a156afeaa4d82cdc6ac938c8c06b35d55a65e7fa
887d01c129bdf271901064625b1a01e5dbfc3e0f
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 9dfa3ee..a341b4d 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -57,19 +57,20 @@ extern int smp_call_function (void (*fun
 			      int retry, int wait);
 
 /*
- * Call a function on all processors
+ * Call a function on all processors.
+ * This needs to be a macro to allow for arch specific dependances on 
+ * sched.h in preempt_*().
  */
-static inline int on_each_cpu(void (*func) (void *info), void *info,
-			      int retry, int wait)
-{
-	int ret = 0;
-
-	preempt_disable();
-	ret = smp_call_function(func, info, retry, wait);
-	func(info);
-	preempt_enable();
-	return ret;
-}
+#define on_each_cpu(func, info, retry, wait)			\
+({								\
+	int ret = 0;						\
+								\
+	preempt_disable();					\
+	ret = smp_call_function(func, info, retry, wait);	\
+	func(info);						\
+	preempt_enable();					\
+	ret;							\
+})
 
 #define MSG_ALL_BUT_SELF	0x8000	/* Assume <32768 CPU's */
 #define MSG_ALL			0x8001
---
0.99.9.GIT

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2005-11-30  4:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-30  4:21 [PATCH 3/9] x86-64 untangle smp.h vs thread_info Benjamin LaHaise

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