MCPcopy Create free account
hub / github.com/F-Stack/f-stack / shutdown_reset

Function shutdown_reset

freebsd/kern/kern_shutdown.c:652–678  ·  view source on GitHub ↗

* Everything done, now reset */

Source from the content-addressed store, hash-verified

650 * Everything done, now reset
651 */
652static void
653shutdown_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)
681static int kassert_warn_only = 0;

Callers

nothing calls this directly

Calls 4

printfFunction · 0.70
DELAYFunction · 0.50
spinlock_enterFunction · 0.50
cpu_resetFunction · 0.50

Tested by

no test coverage detected