| 426 | #endif |
| 427 | |
| 428 | void |
| 429 | cpu_reset(void) |
| 430 | { |
| 431 | #ifdef SMP |
| 432 | struct monitorbuf *mb; |
| 433 | cpuset_t map; |
| 434 | u_int cnt; |
| 435 | |
| 436 | if (smp_started) { |
| 437 | map = all_cpus; |
| 438 | CPU_CLR(PCPU_GET(cpuid), &map); |
| 439 | CPU_ANDNOT(&map, &stopped_cpus); |
| 440 | if (!CPU_EMPTY(&map)) { |
| 441 | printf("cpu_reset: Stopping other CPUs\n"); |
| 442 | stop_cpus(map); |
| 443 | } |
| 444 | |
| 445 | if (PCPU_GET(cpuid) != 0) { |
| 446 | cpu_reset_proxyid = PCPU_GET(cpuid); |
| 447 | cpustop_restartfunc = cpu_reset_proxy; |
| 448 | cpu_reset_proxy_active = 0; |
| 449 | printf("cpu_reset: Restarting BSP\n"); |
| 450 | |
| 451 | /* Restart CPU #0. */ |
| 452 | CPU_SETOF(0, &started_cpus); |
| 453 | mb = &pcpu_find(0)->pc_monitorbuf; |
| 454 | atomic_store_int(&mb->stop_state, |
| 455 | MONITOR_STOPSTATE_RUNNING); |
| 456 | |
| 457 | cnt = 0; |
| 458 | while (cpu_reset_proxy_active == 0 && cnt < 10000000) { |
| 459 | ia32_pause(); |
| 460 | cnt++; /* Wait for BSP to announce restart */ |
| 461 | } |
| 462 | if (cpu_reset_proxy_active == 0) { |
| 463 | printf("cpu_reset: Failed to restart BSP\n"); |
| 464 | } else { |
| 465 | cpu_reset_proxy_active = 2; |
| 466 | while (1) |
| 467 | ia32_pause(); |
| 468 | /* NOTREACHED */ |
| 469 | } |
| 470 | } |
| 471 | |
| 472 | DELAY(1000000); |
| 473 | } |
| 474 | #endif |
| 475 | cpu_reset_real(); |
| 476 | /* NOTREACHED */ |
| 477 | } |
| 478 | |
| 479 | bool |
| 480 | cpu_mwait_usable(void) |
nothing calls this directly
no test coverage detected