Lines Matching refs:cpu
34 static void change_cpu_under_node(struct cpu *cpu, in change_cpu_under_node() argument
37 int cpuid = cpu->dev.id; in change_cpu_under_node()
40 cpu->node_id = to_nid; in change_cpu_under_node()
45 struct cpu *cpu = container_of(dev, struct cpu, dev); in cpu_subsys_online() local
61 change_cpu_under_node(cpu, from_nid, to_nid); in cpu_subsys_online()
71 void unregister_cpu(struct cpu *cpu) in unregister_cpu() argument
73 int logical_cpu = cpu->dev.id; in unregister_cpu()
77 device_unregister(&cpu->dev); in unregister_cpu()
141 struct cpu *cpu = container_of(dev, struct cpu, dev); in show_crash_notes() local
146 cpunum = cpu->dev.id; in show_crash_notes()
330 int register_cpu(struct cpu *cpu, int num) in register_cpu() argument
334 cpu->node_id = cpu_to_node(num); in register_cpu()
335 memset(&cpu->dev, 0x00, sizeof(struct device)); in register_cpu()
336 cpu->dev.id = num; in register_cpu()
337 cpu->dev.bus = &cpu_subsys; in register_cpu()
338 cpu->dev.release = cpu_device_release; in register_cpu()
339 cpu->dev.offline_disabled = !cpu->hotpluggable; in register_cpu()
340 cpu->dev.offline = !cpu_online(num); in register_cpu()
341 cpu->dev.of_node = of_get_cpu_node(num, NULL); in register_cpu()
343 cpu->dev.bus->uevent = cpu_uevent; in register_cpu()
345 cpu->dev.groups = common_cpu_attr_groups; in register_cpu()
346 if (cpu->hotpluggable) in register_cpu()
347 cpu->dev.groups = hotplugable_cpu_attr_groups; in register_cpu()
348 error = device_register(&cpu->dev); in register_cpu()
350 per_cpu(cpu_sys_devices, num) = &cpu->dev; in register_cpu()
357 struct device *get_cpu_device(unsigned cpu) in get_cpu_device() argument
359 if (cpu < nr_cpu_ids && cpu_possible(cpu)) in get_cpu_device()
360 return per_cpu(cpu_sys_devices, cpu); in get_cpu_device()
449 bool cpu_is_hotpluggable(unsigned cpu) in cpu_is_hotpluggable() argument
451 struct device *dev = get_cpu_device(cpu); in cpu_is_hotpluggable()
452 return dev && container_of(dev, struct cpu, dev)->hotpluggable; in cpu_is_hotpluggable()
457 static DEFINE_PER_CPU(struct cpu, cpu_devices);