diff options
author | Masao Uebayashi <uebayasi@cvs.openbsd.org> | 2013-11-23 07:20:53 +0000 |
---|---|---|
committer | Masao Uebayashi <uebayasi@cvs.openbsd.org> | 2013-11-23 07:20:53 +0000 |
commit | 7c4548a0cd84a9d1aa4ee43de9ae9f07dd1f5af3 (patch) | |
tree | c7a237b7b57207b27738274263d96d1c82227e6b /sys | |
parent | 538128ae6098beafe1413d8d7dead5429abd5efb (diff) |
Run doshutdownhooks() and config_suspend() even when boot() is called while
cold != 0. Indent and make hppa/hppa64 boot() closer to others.
OK kettenis@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hppa/hppa/machdep.c | 57 | ||||
-rw-r--r-- | sys/arch/hppa64/hppa64/machdep.c | 55 |
2 files changed, 57 insertions, 55 deletions
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c index ea45eed6328..172f5a5a8d3 100644 --- a/sys/arch/hppa/hppa/machdep.c +++ b/sys/arch/hppa/hppa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.212 2013/09/28 12:40:29 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.213 2013/11/23 07:20:52 uebayasi Exp $ */ /* * Copyright (c) 1999-2003 Michael Shalayeff @@ -892,41 +892,42 @@ boot(int howto) /* (Unless the user explicitly asked for reboot.) */ if ((howto & RB_USERREQ) == 0) howto |= RB_HALT; - } else { + goto haltsys; + } - boothowto = howto | (boothowto & RB_HALT); - - if (!(howto & RB_NOSYNC)) { - waittime = 0; - vfs_shutdown(); - /* - * If we've been adjusting the clock, the todr - * will be out of synch; adjust it now unless - * the system was sitting in ddb. - */ - if ((howto & RB_TIMEBAD) == 0) - resettodr(); - else - printf("WARNING: not updating battery clock\n"); - } - if_downall(); + boothowto = howto | (boothowto & RB_HALT); + + if (!(howto & RB_NOSYNC)) { + waittime = 0; + vfs_shutdown(); + /* + * If we've been adjusting the clock, the todr + * will be out of synch; adjust it now unless + * the system was sitting in ddb. + */ + if ((howto & RB_TIMEBAD) == 0) + resettodr(); + else + printf("WARNING: not updating battery clock\n"); + } + if_downall(); - /* XXX probably save howto into stable storage */ + /* XXX probably save howto into stable storage */ - uvm_shutdown(); - splhigh(); + uvm_shutdown(); + splhigh(); - if (howto & RB_DUMP) - dumpsys(); + if (howto & RB_DUMP) + dumpsys(); - doshutdownhooks(); - if (!TAILQ_EMPTY(&alldevs)) - config_suspend(TAILQ_FIRST(&alldevs), DVACT_POWERDOWN); +haltsys: + doshutdownhooks(); + if (!TAILQ_EMPTY(&alldevs)) + config_suspend(TAILQ_FIRST(&alldevs), DVACT_POWERDOWN); #ifdef MULTIPROCESSOR - hppa_ipi_broadcast(HPPA_IPI_HALT); + hppa_ipi_broadcast(HPPA_IPI_HALT); #endif - } /* in case we came on powerfail interrupt */ if (cold_hook) diff --git a/sys/arch/hppa64/hppa64/machdep.c b/sys/arch/hppa64/hppa64/machdep.c index 24f3e9edf7e..5fe3d4208e8 100644 --- a/sys/arch/hppa64/hppa64/machdep.c +++ b/sys/arch/hppa64/hppa64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.52 2013/09/28 12:40:29 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.53 2013/11/23 07:20:52 uebayasi Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -542,37 +542,38 @@ boot(int howto) /* (Unless the user explicitly asked for reboot.) */ if ((howto & RB_USERREQ) == 0) howto |= RB_HALT; - } else { + goto haltsys; + } - boothowto = howto | (boothowto & RB_HALT); - - if (!(howto & RB_NOSYNC)) { - waittime = 0; - vfs_shutdown(); - /* - * If we've been adjusting the clock, the todr - * will be out of synch; adjust it now unless - * the system was sitting in ddb. - */ - if ((howto & RB_TIMEBAD) == 0) - resettodr(); - else - printf("WARNING: not updating battery clock\n"); - } - if_downall(); + boothowto = howto | (boothowto & RB_HALT); + + if (!(howto & RB_NOSYNC)) { + waittime = 0; + vfs_shutdown(); + /* + * If we've been adjusting the clock, the todr + * will be out of synch; adjust it now unless + * the system was sitting in ddb. + */ + if ((howto & RB_TIMEBAD) == 0) + resettodr(); + else + printf("WARNING: not updating battery clock\n"); + } + if_downall(); - /* XXX probably save howto into stable storage */ + /* XXX probably save howto into stable storage */ - uvm_shutdown(); - splhigh(); + uvm_shutdown(); + splhigh(); - if (howto & RB_DUMP) - dumpsys(); + if (howto & RB_DUMP) + dumpsys(); - doshutdownhooks(); - if (!TAILQ_EMPTY(&alldevs)) - config_suspend(TAILQ_FIRST(&alldevs), DVACT_POWERDOWN); - } +haltsys: + doshutdownhooks(); + if (!TAILQ_EMPTY(&alldevs)) + config_suspend(TAILQ_FIRST(&alldevs), DVACT_POWERDOWN); /* in case we came on powerfail interrupt */ if (cold_hook) |