|
@@ -72,6 +72,38 @@ void unregister_cpu(struct cpu *cpu)
|
|
|
per_cpu(cpu_sys_devices, logical_cpu) = NULL;
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
|
|
|
+static ssize_t cpu_probe_store(struct class *class, const char *buf,
|
|
|
+ size_t count)
|
|
|
+{
|
|
|
+ return arch_cpu_probe(buf, count);
|
|
|
+}
|
|
|
+
|
|
|
+static ssize_t cpu_release_store(struct class *class, const char *buf,
|
|
|
+ size_t count)
|
|
|
+{
|
|
|
+ return arch_cpu_release(buf, count);
|
|
|
+}
|
|
|
+
|
|
|
+static CLASS_ATTR(probe, S_IWUSR, NULL, cpu_probe_store);
|
|
|
+static CLASS_ATTR(release, S_IWUSR, NULL, cpu_release_store);
|
|
|
+
|
|
|
+int __init cpu_probe_release_init(void)
|
|
|
+{
|
|
|
+ int rc;
|
|
|
+
|
|
|
+ rc = sysfs_create_file(&cpu_sysdev_class.kset.kobj,
|
|
|
+ &class_attr_probe.attr);
|
|
|
+ if (!rc)
|
|
|
+ rc = sysfs_create_file(&cpu_sysdev_class.kset.kobj,
|
|
|
+ &class_attr_release.attr);
|
|
|
+
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+device_initcall(cpu_probe_release_init);
|
|
|
+#endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */
|
|
|
+
|
|
|
#else /* ... !CONFIG_HOTPLUG_CPU */
|
|
|
static inline void register_cpu_control(struct cpu *cpu)
|
|
|
{
|