static int __init topology_init(void) { int cpu; register_nodes(); register_cpu_notifier(&sysfs_cpu_nb); for_each_possible_cpu(cpu) { struct cpu *c = &per_cpu(cpu_devices, cpu); /* * For now, we just see if the system supports making * the RTAS calls for CPU hotplug. But, there may be a * more comprehensive way to do this for an individual * CPU. For instance, the boot cpu might never be valid * for hotplugging. */ if (ppc_md.cpu_die) c->hotpluggable = 1; if (cpu_online(cpu) || c->hotpluggable) { register_cpu(c, cpu); device_create_file(&c->dev, &dev_attr_physical_id); } if (cpu_online(cpu)) register_cpu_online(cpu); } #ifdef CONFIG_PPC64 sysfs_create_dscr_default(); #endif /* CONFIG_PPC64 */ return 0; }
static int __init topology_init(void) { int cpu; register_nodes(); register_cpu_notifier(&sysfs_cpu_nb); for_each_possible_cpu(cpu) { struct cpu *c = &per_cpu(cpu_devices, cpu); /* * For now, we just see if the system supports making * the RTAS calls for CPU hotplug. But, there may be a * more comprehensive way to do this for an individual * CPU. For instance, the boot cpu might never be valid * for hotplugging. */ if (!ppc_md.cpu_die) c->no_control = 1; if (cpu_online(cpu) || (c->no_control == 0)) { register_cpu(c, cpu); sysdev_create_file(&c->sysdev, &attr_physical_id); } if (cpu_online(cpu)) register_cpu_online(cpu); } return 0; }
static int __init topology_init(void) { int cpu; register_nodes(); register_cpu_notifier(&sysfs_cpu_nb); for_each_possible_cpu(cpu) { struct cpu *c = &per_cpu(cpu_devices, cpu); if (ppc_md.cpu_die) c->hotpluggable = 1; if (cpu_online(cpu) || c->hotpluggable) { register_cpu(c, cpu); device_create_file(&c->dev, &dev_attr_physical_id); } if (cpu_online(cpu)) register_cpu_online(cpu); } #ifdef CONFIG_PPC64 sysfs_create_dscr_default(); #endif return 0; }
static int __devinit sysfs_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned int)(long)hcpu; switch (action) { case CPU_ONLINE: register_cpu_online(cpu); break; #ifdef CONFIG_HOTPLUG_CPU case CPU_DEAD: unregister_cpu_online(cpu); break; #endif } return NOTIFY_OK; }
static int __init topology_init(void) { int cpu; struct node *parent = NULL; register_nodes(); register_cpu_notifier(&sysfs_cpu_nb); for_each_cpu(cpu) { struct cpu *c = &per_cpu(cpu_devices, cpu); #ifdef CONFIG_NUMA /* The node to which a cpu belongs can't be known * until the cpu is made present. */ parent = NULL; if (cpu_present(cpu)) parent = &node_devices[cpu_to_node(cpu)]; #endif /* * For now, we just see if the system supports making * the RTAS calls for CPU hotplug. But, there may be a * more comprehensive way to do this for an individual * CPU. For instance, the boot cpu might never be valid * for hotplugging. */ if (!ppc_md.cpu_die) c->no_control = 1; if (cpu_online(cpu) || (c->no_control == 0)) { register_cpu(c, cpu, parent); sysdev_create_file(&c->sysdev, &attr_physical_id); } if (cpu_online(cpu)) register_cpu_online(cpu); } return 0; }
static int __init topology_init(void) { int cpu; register_nodes(); check_mmu_stats(); register_cpu_notifier(&sysfs_cpu_nb); for_each_possible_cpu(cpu) { struct cpu *c = &per_cpu(cpu_devices, cpu); register_cpu(c, cpu); if (cpu_online(cpu)) register_cpu_online(cpu); } return 0; }