Lines Matching refs:cpu
35 static void change_cpu_under_node(struct cpu *cpu, in change_cpu_under_node() argument
38 int cpuid = cpu->dev.id; in change_cpu_under_node()
41 cpu->node_id = to_nid; in change_cpu_under_node()
46 struct cpu *cpu = container_of(dev, struct cpu, dev); in cpu_subsys_online() local
62 change_cpu_under_node(cpu, from_nid, to_nid); in cpu_subsys_online()
72 void unregister_cpu(struct cpu *cpu) in unregister_cpu() argument
74 int logical_cpu = cpu->dev.id; in unregister_cpu()
78 device_unregister(&cpu->dev); in unregister_cpu()
142 struct cpu *cpu = container_of(dev, struct cpu, dev); in show_crash_notes() local
147 cpunum = cpu->dev.id; in show_crash_notes()
355 int register_cpu(struct cpu *cpu, int num) in register_cpu() argument
359 cpu->node_id = cpu_to_node(num); in register_cpu()
360 memset(&cpu->dev, 0x00, sizeof(struct device)); in register_cpu()
361 cpu->dev.id = num; in register_cpu()
362 cpu->dev.bus = &cpu_subsys; in register_cpu()
363 cpu->dev.release = cpu_device_release; in register_cpu()
364 cpu->dev.offline_disabled = !cpu->hotpluggable; in register_cpu()
365 cpu->dev.offline = !cpu_online(num); in register_cpu()
366 cpu->dev.of_node = of_get_cpu_node(num, NULL); in register_cpu()
368 cpu->dev.bus->uevent = cpu_uevent; in register_cpu()
370 cpu->dev.groups = common_cpu_attr_groups; in register_cpu()
371 if (cpu->hotpluggable) in register_cpu()
372 cpu->dev.groups = hotplugable_cpu_attr_groups; in register_cpu()
373 error = device_register(&cpu->dev); in register_cpu()
375 per_cpu(cpu_sys_devices, num) = &cpu->dev; in register_cpu()
382 struct device *get_cpu_device(unsigned cpu) in get_cpu_device() argument
384 if (cpu < nr_cpu_ids && cpu_possible(cpu)) in get_cpu_device()
385 return per_cpu(cpu_sys_devices, cpu); in get_cpu_device()
478 bool cpu_is_hotpluggable(unsigned cpu) in cpu_is_hotpluggable() argument
480 struct device *dev = get_cpu_device(cpu); in cpu_is_hotpluggable()
481 return dev && container_of(dev, struct cpu, dev)->hotpluggable; in cpu_is_hotpluggable()
486 static DEFINE_PER_CPU(struct cpu, cpu_devices);