summaryrefslogtreecommitdiffstats
path: root/kernel/arch/x86/lib/cache-smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/arch/x86/lib/cache-smp.c')
-rw-r--r--kernel/arch/x86/lib/cache-smp.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/kernel/arch/x86/lib/cache-smp.c b/kernel/arch/x86/lib/cache-smp.c
new file mode 100644
index 000000000..a3c668875
--- /dev/null
+++ b/kernel/arch/x86/lib/cache-smp.c
@@ -0,0 +1,19 @@
+#include <linux/smp.h>
+#include <linux/module.h>
+
+static void __wbinvd(void *dummy)
+{
+ wbinvd();
+}
+
+void wbinvd_on_cpu(int cpu)
+{
+ smp_call_function_single(cpu, __wbinvd, NULL, 1);
+}
+EXPORT_SYMBOL(wbinvd_on_cpu);
+
+int wbinvd_on_all_cpus(void)
+{
+ return on_each_cpu(__wbinvd, NULL, 1);
+}
+EXPORT_SYMBOL(wbinvd_on_all_cpus);