| 243 | } |
| 244 | |
| 245 | void |
| 246 | cpu_mp_start(void) |
| 247 | { |
| 248 | int error, cpuid; |
| 249 | cpuset_t cpumask; |
| 250 | |
| 251 | mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); |
| 252 | |
| 253 | CPU_ZERO(&all_cpus); |
| 254 | platform_cpu_mask(&cpumask); |
| 255 | |
| 256 | while (!CPU_EMPTY(&cpumask)) { |
| 257 | cpuid = CPU_FFS(&cpumask) - 1; |
| 258 | CPU_CLR(cpuid, &cpumask); |
| 259 | |
| 260 | if (cpuid >= MAXCPU) { |
| 261 | printf("cpu_mp_start: ignoring AP #%d.\n", cpuid); |
| 262 | continue; |
| 263 | } |
| 264 | |
| 265 | if (cpuid != platform_processor_id()) { |
| 266 | if ((error = start_ap(cpuid)) != 0) { |
| 267 | printf("AP #%d failed to start: %d\n", cpuid, error); |
| 268 | continue; |
| 269 | } |
| 270 | if (bootverbose) |
| 271 | printf("AP #%d started!\n", cpuid); |
| 272 | } |
| 273 | CPU_SET(cpuid, &all_cpus); |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | void |
| 278 | smp_init_secondary(u_int32_t cpuid) |
nothing calls this directly
no test coverage detected