aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/smp.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/linux/smp.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'include/linux/smp.h')
-rw-r--r--include/linux/smp.h37
1 files changed, 17 insertions, 20 deletions
diff --git a/include/linux/smp.h b/include/linux/smp.h
index f86d40768e7f..53b1beef27ad 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -10,12 +10,14 @@
10#include <linux/types.h> 10#include <linux/types.h>
11#include <linux/list.h> 11#include <linux/list.h>
12#include <linux/cpumask.h> 12#include <linux/cpumask.h>
13#include <linux/init.h>
13 14
14extern void cpu_idle(void); 15extern void cpu_idle(void);
15 16
17typedef void (*smp_call_func_t)(void *info);
16struct call_single_data { 18struct call_single_data {
17 struct list_head list; 19 struct list_head list;
18 void (*func) (void *info); 20 smp_call_func_t func;
19 void *info; 21 void *info;
20 u16 flags; 22 u16 flags;
21 u16 priv; 23 u16 priv;
@@ -24,8 +26,8 @@ struct call_single_data {
24/* total number of cpus in this system (may exceed NR_CPUS) */ 26/* total number of cpus in this system (may exceed NR_CPUS) */
25extern unsigned int total_cpus; 27extern unsigned int total_cpus;
26 28
27int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, 29int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
28 int wait); 30 int wait);
29 31
30#ifdef CONFIG_SMP 32#ifdef CONFIG_SMP
31 33
@@ -69,15 +71,15 @@ extern void smp_cpus_done(unsigned int max_cpus);
69/* 71/*
70 * Call a function on all other processors 72 * Call a function on all other processors
71 */ 73 */
72int smp_call_function(void(*func)(void *info), void *info, int wait); 74int smp_call_function(smp_call_func_t func, void *info, int wait);
73void smp_call_function_many(const struct cpumask *mask, 75void smp_call_function_many(const struct cpumask *mask,
74 void (*func)(void *info), void *info, bool wait); 76 smp_call_func_t func, void *info, bool wait);
75 77
76void __smp_call_function_single(int cpuid, struct call_single_data *data, 78void __smp_call_function_single(int cpuid, struct call_single_data *data,
77 int wait); 79 int wait);
78 80
79int smp_call_function_any(const struct cpumask *mask, 81int smp_call_function_any(const struct cpumask *mask,
80 void (*func)(void *info), void *info, int wait); 82 smp_call_func_t func, void *info, int wait);
81 83
82/* 84/*
83 * sends a 'pull timer' event to a remote CPU 85 * sends a 'pull timer' event to a remote CPU
@@ -88,28 +90,21 @@ extern void smp_send_pull_timers(int cpu);
88 * Generic and arch helpers 90 * Generic and arch helpers
89 */ 91 */
90#ifdef CONFIG_USE_GENERIC_SMP_HELPERS 92#ifdef CONFIG_USE_GENERIC_SMP_HELPERS
93void __init call_function_init(void);
91void generic_smp_call_function_single_interrupt(void); 94void generic_smp_call_function_single_interrupt(void);
92void generic_smp_call_function_interrupt(void); 95void generic_smp_call_function_interrupt(void);
93void ipi_call_lock(void); 96void ipi_call_lock(void);
94void ipi_call_unlock(void); 97void ipi_call_unlock(void);
95void ipi_call_lock_irq(void); 98void ipi_call_lock_irq(void);
96void ipi_call_unlock_irq(void); 99void ipi_call_unlock_irq(void);
100#else
101static inline void call_function_init(void) { }
97#endif 102#endif
98 103
99/* 104/*
100 * Call a function on all processors 105 * Call a function on all processors
101 */ 106 */
102int on_each_cpu(void (*func) (void *info), void *info, int wait); 107int on_each_cpu(smp_call_func_t func, void *info, int wait);
103
104#define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */
105#define MSG_ALL 0x8001
106
107#define MSG_INVALIDATE_TLB 0x0001 /* Remote processor TLB invalidate */
108#define MSG_STOP_CPU 0x0002 /* Sent to shut down slave CPU's
109 * when rebooting
110 */
111#define MSG_RESCHEDULE 0x0003 /* Reschedule request from master CPU*/
112#define MSG_CALL_FUNCTION 0x0004 /* Call function on all other CPUs */
113 108
114/* 109/*
115 * Mark the boot cpu "online" so that it can call console drivers in 110 * Mark the boot cpu "online" so that it can call console drivers in
@@ -118,6 +113,8 @@ int on_each_cpu(void (*func) (void *info), void *info, int wait);
118void smp_prepare_boot_cpu(void); 113void smp_prepare_boot_cpu(void);
119 114
120extern unsigned int setup_max_cpus; 115extern unsigned int setup_max_cpus;
116extern void __init setup_nr_cpu_ids(void);
117extern void __init smp_init(void);
121 118
122#else /* !SMP */ 119#else /* !SMP */
123 120
@@ -127,7 +124,7 @@ static inline void smp_send_stop(void) { }
127 * These macros fold the SMP functionality into a single CPU system 124 * These macros fold the SMP functionality into a single CPU system
128 */ 125 */
129#define raw_smp_processor_id() 0 126#define raw_smp_processor_id() 0
130static inline int up_smp_call_function(void (*func)(void *), void *info) 127static inline int up_smp_call_function(smp_call_func_t func, void *info)
131{ 128{
132 return 0; 129 return 0;
133} 130}
@@ -145,10 +142,10 @@ static inline void smp_send_reschedule(int cpu) { }
145#define smp_prepare_boot_cpu() do {} while (0) 142#define smp_prepare_boot_cpu() do {} while (0)
146#define smp_call_function_many(mask, func, info, wait) \ 143#define smp_call_function_many(mask, func, info, wait) \
147 (up_smp_call_function(func, info)) 144 (up_smp_call_function(func, info))
148static inline void init_call_single_data(void) { } 145static inline void call_function_init(void) { }
149 146
150static inline int 147static inline int
151smp_call_function_any(const struct cpumask *mask, void (*func)(void *info), 148smp_call_function_any(const struct cpumask *mask, smp_call_func_t func,
152 void *info, int wait) 149 void *info, int wait)
153{ 150{
154 return smp_call_function_single(0, func, info, wait); 151 return smp_call_function_single(0, func, info, wait);