aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/smp.h
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-21 11:28:03 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-21 11:28:03 +0100
commit6e159fba3f0236fbcc65ba89f12cf07425b1f7aa (patch)
treea3422c4c31a83063cfc5ccfe332d31552985b387 /xen/include/xen/smp.h
parentc03842a4e92b1b35d15c090e94728c6dd1f6f624 (diff)
downloadxen-6e159fba3f0236fbcc65ba89f12cf07425b1f7aa.tar.gz
xen-6e159fba3f0236fbcc65ba89f12cf07425b1f7aa.tar.bz2
xen-6e159fba3f0236fbcc65ba89f12cf07425b1f7aa.zip
New SMP IPI interface function called on_selected_cpus(), currently implemented
only for x86. The x86 implementation of smp_call_function has been simplified and is now based on on_slected_cpus(). Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include/xen/smp.h')
-rw-r--r--xen/include/xen/smp.h48
1 files changed, 31 insertions, 17 deletions
diff --git a/xen/include/xen/smp.h b/xen/include/xen/smp.h
index f64c5b056d..cefce3ff3f 100644
--- a/xen/include/xen/smp.h
+++ b/xen/include/xen/smp.h
@@ -45,33 +45,35 @@ extern void smp_cpus_done(unsigned int max_cpus);
* Call a function on all other processors
*/
extern int smp_call_function(
- void (*func) (void *info), void *info, int retry, int wait);
+ void (*func) (void *info),
+ void *info,
+ int retry,
+ int wait);
+
+/*
+ * Call a function on a selection of processors
+ */
+extern int on_selected_cpus(
+ cpumask_t selected,
+ void (*func) (void *info),
+ void *info,
+ int retry,
+ int wait);
/*
* Call a function on all processors
*/
-static inline int on_each_cpu(void (*func) (void *info), void *info,
- int retry, int wait)
+static inline int on_each_cpu(
+ void (*func) (void *info),
+ void *info,
+ int retry,
+ int wait)
{
int ret = smp_call_function(func, info, retry, wait);
func(info);
return ret;
}
-extern volatile unsigned long smp_msg_data;
-extern volatile int smp_src_cpu;
-extern volatile int smp_msg_id;
-
-#define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */
-#define MSG_ALL 0x8001
-
-#define MSG_INVALIDATE_TLB 0x0001 /* Remote processor TLB invalidate */
-#define MSG_STOP_CPU 0x0002 /* Sent to shut down slave CPU's
- * when rebooting
- */
-#define MSG_RESCHEDULE 0x0003 /* Reschedule request from master CPU*/
-#define MSG_CALL_FUNCTION 0x0004 /* Call function on all other CPUs */
-
/*
* Mark the boot cpu "online" so that it can call console drivers in
* printk() and can access its per-cpu storage.
@@ -93,6 +95,18 @@ void smp_prepare_boot_cpu(void);
#define num_booting_cpus() 1
#define smp_prepare_boot_cpu() do {} while (0)
+static inline int on_selected_cpus(
+ cpumask_t selected,
+ void (*func) (void *info),
+ void *info,
+ int retry,
+ int wait)
+{
+ if ( cpu_isset(0, selected) )
+ func(info);
+ return 0;
+}
+
#endif
#define smp_processor_id() raw_smp_processor_id()