[PATCH 3/9] x86-64 untangle smp.h vs thread_info
From: Benjamin LaHaise (bcrl_at_kvack.org)
Date: 11/30/05
- Previous message: Benjamin LaHaise: "[PATCH 8/9] x86-64 use r10 for current"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 29 Nov 2005 23:21:37 -0500 To: Andi Kleen <ak@suse.de>
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Benjamin LaHaise: "[PATCH 8/9] x86-64 use r10 for current"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: [Infiniband-general] Getting an Infiniband access layer in theLinux kernel
... Richard B. Johnson wrote: ... It means you need to know if something is a macro
or ... an inline function, and do stuff differently. ... To unsubscribe from this
list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
... (Linux-Kernel) - Re: unable to use dpkg 2.6.15-rc2
... > inline function makes any difference? ... The initial conversion
from macro ->inline was subtely broken ... send the line "unsubscribe linux-kernel"
in ... (Linux-Kernel) - Re: Is there stack associated when a executing an inline function?
... A lot of the features of an inline function can be emulated in a macro ... global
variable called xyzzy: ... (comp.lang.c) - Patch: Plustek scanner driver (pt_drv) port to 2.6, correction for 2.6.3
... the inline function kdev_t_to_nr does not exist any longer, ... due to the kdev
device changes in 2.6.3. ... Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
... send the line "unsubscribe linux-kernel" in ... (Linux-Kernel) - Re: [PATCH] Document kfree and vfree NULL usage
... >> pointer? ... >> Or maybe a inline function so it doesn't
break existing code. ... more readable code and smaller memory footprint at the same time.
... send the line "unsubscribe linux-kernel" in ... (Linux-Kernel)