diff options
Diffstat (limited to 'kernel/up.c')
-rw-r--r-- | kernel/up.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/up.c b/kernel/up.c index 1760bf3d1463..ee81ac9af4ca 100644 --- a/kernel/up.c +++ b/kernel/up.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
7 | #include <linux/export.h> | 7 | #include <linux/export.h> |
8 | #include <linux/smp.h> | 8 | #include <linux/smp.h> |
9 | #include <linux/hypervisor.h> | ||
9 | 10 | ||
10 | int smp_call_function_single(int cpu, void (*func) (void *info), void *info, | 11 | int smp_call_function_single(int cpu, void (*func) (void *info), void *info, |
11 | int wait) | 12 | int wait) |
@@ -82,3 +83,20 @@ void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info), | |||
82 | preempt_enable(); | 83 | preempt_enable(); |
83 | } | 84 | } |
84 | EXPORT_SYMBOL(on_each_cpu_cond); | 85 | EXPORT_SYMBOL(on_each_cpu_cond); |
86 | |||
87 | int smp_call_on_cpu(unsigned int cpu, int (*func)(void *), void *par, bool phys) | ||
88 | { | ||
89 | int ret; | ||
90 | |||
91 | if (cpu != 0) | ||
92 | return -ENXIO; | ||
93 | |||
94 | if (phys) | ||
95 | hypervisor_pin_vcpu(0); | ||
96 | ret = func(par); | ||
97 | if (phys) | ||
98 | hypervisor_pin_vcpu(-1); | ||
99 | |||
100 | return ret; | ||
101 | } | ||
102 | EXPORT_SYMBOL_GPL(smp_call_on_cpu); | ||