* Everything done, now reset */
| 650 | * Everything done, now reset |
| 651 | */ |
| 652 | static void |
| 653 | shutdown_reset(void *junk, int howto) |
| 654 | { |
| 655 | |
| 656 | printf("Rebooting...\n"); |
| 657 | DELAY(1000000); /* wait 1 sec for printf's to complete and be read */ |
| 658 | |
| 659 | /* |
| 660 | * Acquiring smp_ipi_mtx here has a double effect: |
| 661 | * - it disables interrupts avoiding CPU0 preemption |
| 662 | * by fast handlers (thus deadlocking against other CPUs) |
| 663 | * - it avoids deadlocks against smp_rendezvous() or, more |
| 664 | * generally, threads busy-waiting, with this spinlock held, |
| 665 | * and waiting for responses by threads on other CPUs |
| 666 | * (ie. smp_tlb_shootdown()). |
| 667 | * |
| 668 | * For the !SMP case it just needs to handle the former problem. |
| 669 | */ |
| 670 | #ifdef SMP |
| 671 | mtx_lock_spin(&smp_ipi_mtx); |
| 672 | #else |
| 673 | spinlock_enter(); |
| 674 | #endif |
| 675 | |
| 676 | cpu_reset(); |
| 677 | /* NOTREACHED */ /* assuming reset worked */ |
| 678 | } |
| 679 | |
| 680 | #if defined(WITNESS) || defined(INVARIANT_SUPPORT) |
| 681 | static int kassert_warn_only = 0; |
nothing calls this directly
no test coverage detected