Lines Matching defs:cpu

9 #include <linux/cpu.h>
34 static void change_cpu_under_node(struct cpu *cpu,
37 int cpuid = cpu->dev.id;
40 cpu->node_id = to_nid;
45 struct cpu *cpu = container_of(dev, struct cpu, dev);
56 * When hot adding memory to memoryless node and enabling a cpu
57 * on the node, node number of the cpu may internally change.
61 change_cpu_under_node(cpu, from_nid, to_nid);
71 void unregister_cpu(struct cpu *cpu)
73 int logical_cpu = cpu->dev.id;
77 device_unregister(&cpu->dev);
125 .name = "cpu",
126 .dev_name = "cpu",
141 struct cpu *cpu = container_of(dev, struct cpu, dev);
146 cpunum = cpu->dev.id;
149 * Might be reading other cpu's data based on which cpu read thread
150 * has been scheduled. But cpu data (memory) is allocated once during
197 * Print cpu online, possible, present, and system maps
279 * the only way to handle the issue of statically allocated cpu
280 * devices. The different architectures will have their cpu device
283 * by the cpu device.
299 n = sprintf(buf, "cpu:type:" CPU_FEATURE_TYPEFMT ":feature:",
331 * @cpu - cpu->hotpluggable field set to 1 will generate a control file in
337 int register_cpu(struct cpu *cpu, int num)
341 cpu->node_id = cpu_to_node(num);
342 memset(&cpu->dev, 0x00, sizeof(struct device));
343 cpu->dev.id = num;
344 cpu->dev.bus = &cpu_subsys;
345 cpu->dev.release = cpu_device_release;
346 cpu->dev.offline_disabled = !cpu->hotpluggable;
347 cpu->dev.offline = !cpu_online(num);
348 cpu->dev.of_node = of_get_cpu_node(num, NULL);
350 cpu->dev.bus->uevent = cpu_uevent;
352 cpu->dev.groups = common_cpu_attr_groups;
353 if (cpu->hotpluggable)
354 cpu->dev.groups = hotplugable_cpu_attr_groups;
355 error = device_register(&cpu->dev);
357 per_cpu(cpu_sys_devices, num) = &cpu->dev;
364 struct device *get_cpu_device(unsigned cpu)
366 if (cpu < nr_cpu_ids && cpu_possible(cpu))
367 return per_cpu(cpu_sys_devices, cpu);
402 bool cpu_is_hotpluggable(unsigned cpu)
404 struct device *dev = get_cpu_device(cpu);
405 return dev && container_of(dev, struct cpu, dev)->hotpluggable;
410 static DEFINE_PER_CPU(struct cpu, cpu_devices);