From: uebayasi Date: Mon, 6 Jan 2014 16:17:33 +0000 (+0000) Subject: Make macppc/socppc boot() code path more similar to others. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=02e9ee72551e67dd76cd75566aba4fad4b6d8c0d;p=openbsd Make macppc/socppc boot() code path more similar to others. This changes calling boot() during (cold != 0) to not call if_downall() and uvm_shutdown(). Both of which must not be specific to PowerPC. OK mpi@ --- diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c index 5cc113ddf78..090b4bf1143 100644 --- a/sys/arch/macppc/macppc/machdep.c +++ b/sys/arch/macppc/macppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.142 2013/11/18 08:20:22 uebayasi Exp $ */ +/* $OpenBSD: machdep.c,v 1.143 2014/01/06 16:17:33 uebayasi Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -804,8 +804,18 @@ boot(int howto) { static int syncing; + if (cold) { + /* + * If the system is cold, just halt, unless the user + * explicitly asked for reboot. + */ + if ((howto & RB_USERREQ) == 0) + howto |= RB_HALT; + goto haltsys; + } + boothowto = howto; - if (!cold && !(howto & RB_NOSYNC) && !syncing) { + if (!(howto & RB_NOSYNC) && !syncing) { syncing = 1; vfs_shutdown(); /* sync */ @@ -825,8 +835,10 @@ boot(int howto) uvm_shutdown(); splhigh(); - if (!cold && (howto & RB_DUMP)) + if (howto & RB_DUMP) dumpsys(); + +haltsys: doshutdownhooks(); if (!TAILQ_EMPTY(&alldevs)) config_suspend(TAILQ_FIRST(&alldevs), DVACT_POWERDOWN); diff --git a/sys/arch/socppc/socppc/machdep.c b/sys/arch/socppc/socppc/machdep.c index e82bf998b0c..f492f01f7db 100644 --- a/sys/arch/socppc/socppc/machdep.c +++ b/sys/arch/socppc/socppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.38 2013/11/18 08:20:22 uebayasi Exp $ */ +/* $OpenBSD: machdep.c,v 1.39 2014/01/06 16:17:33 uebayasi Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -1038,8 +1038,18 @@ boot(int howto) { static int syncing; + if (cold) { + /* + * If the system is cold, just halt, unless the user + * explicitly asked for reboot. + */ + if ((howto & RB_USERREQ) == 0) + howto |= RB_HALT; + goto haltsys; + } + boothowto = howto; - if (!cold && !(howto & RB_NOSYNC) && !syncing) { + if (!(howto & RB_NOSYNC) && !syncing) { syncing = 1; vfs_shutdown(); /* sync */ @@ -1059,8 +1069,10 @@ boot(int howto) uvm_shutdown(); splhigh(); - if (!cold && (howto & RB_DUMP)) + if ((howto & RB_DUMP)) dumpsys(); + +haltsys: doshutdownhooks(); if (!TAILQ_EMPTY(&alldevs)) config_suspend(TAILQ_FIRST(&alldevs), DVACT_POWERDOWN);