From: uebayasi Date: Sat, 12 Jul 2014 14:12:44 +0000 (+0000) Subject: boot(9), reboot(9): Migrate MD callers of boot(9) to reboot(9) X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=818c7e6d477e10473dacb17abc219d649817739b;p=openbsd boot(9), reboot(9): Migrate MD callers of boot(9) to reboot(9) I have found that some ports call boot(9) from machine-dependent code to reboot system. These should be changed to either: - Sending signal to init(8) to trigger it to shutdown system cleanly, like acpi(4) does, in cases where found problems don't prevent system from working immediately, or - Just doing panic(9) if the situation is severely broken. For now, just rewrite boot() to reboot(). Actual fixes follow. Discussed with & OK from kettenis@ --- diff --git a/sys/arch/hppa/dev/power.c b/sys/arch/hppa/dev/power.c index 80b1b317846..0c0318b0bec 100644 --- a/sys/arch/hppa/dev/power.c +++ b/sys/arch/hppa/dev/power.c @@ -1,4 +1,4 @@ -/* $OpenBSD: power.c,v 1.6 2014/03/29 18:09:29 guenther Exp $ */ +/* $OpenBSD: power.c,v 1.7 2014/07/12 14:12:44 uebayasi Exp $ */ /* * Copyright (c) 2003 Michael Shalayeff @@ -154,7 +154,7 @@ power_thread_dr(void *v) * switch and thus we have do dampen it ourselves. */ if (sc->sc_dr_cnt == hz / 10) - boot(RB_POWERDOWN | RB_HALT); + reboot(RB_POWERDOWN | RB_HALT); tsleep(v, PWAIT, "drpower", 10); } diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c index b38152df010..0aed6c706ba 100644 --- a/sys/arch/hppa/hppa/machdep.c +++ b/sys/arch/hppa/hppa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.226 2014/07/10 21:46:02 mpi Exp $ */ +/* $OpenBSD: machdep.c,v 1.227 2014/07/12 14:12:44 uebayasi Exp $ */ /* * Copyright (c) 1999-2003 Michael Shalayeff @@ -998,7 +998,7 @@ hpmc_dump(void) printf("HPMC\n"); cold = 0; - boot(RB_NOSYNC); + reboot(RB_NOSYNC); } int diff --git a/sys/arch/hppa64/dev/power.c b/sys/arch/hppa64/dev/power.c index 0f06d7e7c5e..ee85fcf62a3 100644 --- a/sys/arch/hppa64/dev/power.c +++ b/sys/arch/hppa64/dev/power.c @@ -1,4 +1,4 @@ -/* $OpenBSD: power.c,v 1.2 2014/03/29 18:09:29 guenther Exp $ */ +/* $OpenBSD: power.c,v 1.3 2014/07/12 14:12:44 uebayasi Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -123,7 +123,7 @@ power_thread_reg(void *v) : "=&r" (r) : "r" (sc->sc_pwr_reg)); if (!(r & 1)) - boot(RB_POWERDOWN | RB_HALT); + reboot(RB_POWERDOWN | RB_HALT); tsleep(v, PWAIT, "regpower", 10); } diff --git a/sys/arch/hppa64/hppa64/machdep.c b/sys/arch/hppa64/hppa64/machdep.c index b74cc83b73e..d9158d892cd 100644 --- a/sys/arch/hppa64/hppa64/machdep.c +++ b/sys/arch/hppa64/hppa64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.64 2014/07/10 21:46:03 mpi Exp $ */ +/* $OpenBSD: machdep.c,v 1.65 2014/07/12 14:12:44 uebayasi Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -631,7 +631,7 @@ hpmc_dump(void) printf("HPMC\n"); cold = 0; - boot(RB_NOSYNC); + reboot(RB_NOSYNC); } int diff --git a/sys/arch/sgi/sgi/ip27_machdep.c b/sys/arch/sgi/sgi/ip27_machdep.c index c86e2b4c619..a35ded7e2ff 100644 --- a/sys/arch/sgi/sgi/ip27_machdep.c +++ b/sys/arch/sgi/sgi/ip27_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip27_machdep.c,v 1.59 2014/05/19 21:18:42 miod Exp $ */ +/* $OpenBSD: ip27_machdep.c,v 1.60 2014/07/12 14:12:44 uebayasi Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -934,5 +934,5 @@ ip27_nmi(void *arg) (void)kdb_trap(-1, &nmi_frame); #endif printf("Resetting system...\n"); - boot(RB_USERREQ); + reboot(RB_USERREQ); } diff --git a/sys/arch/sgi/sgi/ip30_machdep.c b/sys/arch/sgi/sgi/ip30_machdep.c index 36d11090b08..6992aefa535 100644 --- a/sys/arch/sgi/sgi/ip30_machdep.c +++ b/sys/arch/sgi/sgi/ip30_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip30_machdep.c,v 1.60 2014/04/03 08:07:16 mpi Exp $ */ +/* $OpenBSD: ip30_machdep.c,v 1.61 2014/07/12 14:12:44 uebayasi Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -483,7 +483,7 @@ ip30_nmi_handler() splx(s); printf("Resetting system...\n"); - boot(RB_USERREQ); + reboot(RB_USERREQ); } #endif diff --git a/sys/arch/sparc64/dev/psycho.c b/sys/arch/sparc64/dev/psycho.c index 09e5bdef6cc..04292caa1d5 100644 --- a/sys/arch/sparc64/dev/psycho.c +++ b/sys/arch/sparc64/dev/psycho.c @@ -1,4 +1,4 @@ -/* $OpenBSD: psycho.c,v 1.70 2014/01/24 09:36:23 kettenis Exp $ */ +/* $OpenBSD: psycho.c,v 1.71 2014/07/12 14:12:44 uebayasi Exp $ */ /* $NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp $ */ /* @@ -839,7 +839,7 @@ psycho_powerfail(void *arg) * We lost power. Try to shut down NOW. */ printf("Power Failure Detected: Shutting down NOW.\n"); - boot(RB_POWERDOWN|RB_HALT); + reboot(RB_POWERDOWN | RB_HALT); return (1); } diff --git a/sys/arch/sparc64/dev/sbus.c b/sys/arch/sparc64/dev/sbus.c index ee1f1bebc60..082d015f6b5 100644 --- a/sys/arch/sparc64/dev/sbus.c +++ b/sys/arch/sparc64/dev/sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbus.c,v 1.39 2010/12/26 15:37:20 kettenis Exp $ */ +/* $OpenBSD: sbus.c,v 1.40 2014/07/12 14:12:44 uebayasi Exp $ */ /* $NetBSD: sbus.c,v 1.46 2001/10/07 20:30:41 eeh Exp $ */ /*- @@ -571,7 +571,7 @@ sbus_overtemp(void *arg) /* Should try a clean shutdown first */ printf("DANGER: OVER TEMPERATURE detected\nShutting down...\n"); delay(20); - boot(RB_POWERDOWN|RB_HALT); + reboot(RB_POWERDOWN | RB_HALT); /*NOTREACHED*/ return (1); }