From 7a90d5732b29d7724f332d8639860539b423c9cd Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sat, 24 Nov 2001 17:53:42 +0000 Subject: Harmonize boot() logic across arches: - ensure RB_DUMP | RB_HALT will cause a dump - or RB_HALT if (cold) While there, honor RB_TIMEBAD on sparc64. --- sys/arch/sparc/sparc/machdep.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'sys/arch/sparc') diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index a1a272fbc87..26afa435d6d 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.70 2001/11/22 09:49:43 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.71 2001/11/24 17:53:41 miod Exp $ */ /* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */ /* @@ -675,9 +675,10 @@ boot(howto) int i; static char str[4]; /* room for "-sd\0" */ + /* If system is cold, just halt. */ if (cold) { - printf("halted\n\n"); - romhalt(); + howto |= RB_HALT; + goto haltsys; } fb_unblank(); @@ -703,8 +704,15 @@ boot(howto) } } (void) splhigh(); /* ??? */ + + if (howto & RB_DUMP) + dumpsys(); + +haltsys: + /* Run any shutdown hooks */ + doshutdownhooks(); + if ((howto & RB_HALT) || (howto & RB_POWERDOWN)) { - doshutdownhooks(); #if defined(SUN4M) if (howto & RB_POWERDOWN) { #if NPOWER > 0 || NTCTRL >0 @@ -722,10 +730,7 @@ boot(howto) printf("halted\n\n"); romhalt(); } - if (howto & RB_DUMP) - dumpsys(); - doshutdownhooks(); printf("rebooting\n\n"); i = 1; if (howto & RB_SINGLE) -- cgit v1.2.3