/* must be called with cpucontrol mutex held */ int __cpu_disable(void) { int cpu = smp_processor_id(); /* * dont permit boot processor for now */ if (cpu == 0 && !bsp_remove_ok) { printk ("Your platform does not support removal of BSP\n"); return (-EBUSY); } if (ia64_platform_is("sn2")) { if (!sn_cpu_disable_allowed(cpu)) return -EBUSY; } set_cpu_online(cpu, false); if (migrate_platform_irqs(cpu)) { set_cpu_online(cpu, true); return -EBUSY; } remove_siblinginfo(cpu); fixup_irqs(); local_flush_tlb_all(); cpu_clear(cpu, cpu_callin_map); return 0; }
/* must be called with cpucontrol mutex held */ int __cpu_disable(void) { int cpu = smp_processor_id(); /* * dont permit boot processor for now */ if (cpu == 0 && !bsp_remove_ok) { printk ("Your platform does not support removal of BSP\n"); return (-EBUSY); } cpu_clear(cpu, cpu_online_map); if (migrate_platform_irqs(cpu)) { cpu_set(cpu, cpu_online_map); return (-EBUSY); } remove_siblinginfo(cpu); cpu_clear(cpu, cpu_online_map); fixup_irqs(); local_flush_tlb_all(); cpu_clear(cpu, cpu_callin_map); return 0; }
int generic_cpu_disable(void) { unsigned int cpu = smp_processor_id(); if (cpu == boot_cpuid) return -EBUSY; cpu_clear(cpu, cpu_online_map); #ifdef CONFIG_PPC64 vdso_data->processorCount--; fixup_irqs(cpu_online_map); #endif return 0; }
int __cpu_disable(void) { int cpu = smp_processor_id(); /* * dont permit boot processor for now */ if (cpu == 0) return -EBUSY; fixup_irqs(); local_flush_tlb_all(); printk ("Disabled cpu %u\n", smp_processor_id()); return 0; }
int generic_cpu_disable(void) { unsigned int cpu = smp_processor_id(); if (cpu == boot_cpuid) return -EBUSY; set_cpu_online(cpu, false); #ifdef CONFIG_PPC64 vdso_data->processorCount--; #endif #if defined(CONFIG_PPC64) || defined(CONFIG_E500) fixup_irqs(cpu_online_mask); #endif return 0; }
int generic_cpu_enable(unsigned int cpu) { /* Do the normal bootup if we haven't * already bootstrapped. */ if (system_state != SYSTEM_RUNNING) return -ENOSYS; /* get the target out of it's holding state */ per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; smp_wmb(); while (!cpu_online(cpu)) cpu_relax(); #ifdef CONFIG_PPC64 fixup_irqs(cpu_online_map); /* counter the irq disable in fixup_irqs */ local_irq_enable(); #endif return 0; }
static void parse_devtree(const char *filename) { FILE *f; void *dt; f = fopen(filename, "rb"); if (!f) goto err; fseek(f, 0, SEEK_END); machine_devtree_size = ftell(f); fseek(f, 0, SEEK_SET); dt = qemu_malloc(machine_devtree_size); if (!dt) goto err_close; machine_devtree = dt; if (fread(dt, machine_devtree_size, 1, f) != 1) goto err_close; if (fdt_check_header(dt)) goto err_close; create_cpus(dt); create_ram(dt); scan_devtree(dt); fixup_irqs(); fclose(f); return; err_close: fclose(f); err: fprintf(stderr, "Failed to load device tree\n"); exit(1); }