Rearrange boot() slightly.

This commit is contained in:
mycroft 1996-03-08 11:40:28 +00:00
parent bd267b1b3c
commit 2732f4510b
1 changed files with 20 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.192 1996/03/05 01:28:51 thorpej Exp $ */ /* $NetBSD: machdep.c,v 1.193 1996/03/08 11:40:28 mycroft Exp $ */
/*- /*-
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved. * Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
@ -691,16 +691,17 @@ struct pcb dumppcb;
void void
boot(howto) boot(howto)
register int howto; int howto;
{ {
extern int cold; extern int cold;
if (cold) { if (cold) {
printf("hit reset please"); howto |= RB_HALT;
for(;;); goto haltsys;
} }
boothowto = howto; boothowto = howto;
if ((howto&RB_NOSYNC) == 0 && waittime < 0) { if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
waittime = 0; waittime = 0;
vfs_shutdown(); vfs_shutdown();
/* /*
@ -709,21 +710,24 @@ boot(howto)
*/ */
resettodr(); resettodr();
} }
/* Disable interrupts. */
splhigh(); splhigh();
/* Do a dump if requested. */
if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP)
dumpsys();
haltsys:
doshutdownhooks();
if (howto & RB_HALT) { if (howto & RB_HALT) {
doshutdownhooks();
printf("\n"); printf("\n");
printf("The operating system has halted.\n"); printf("The operating system has halted.\n");
printf("Please press any key to reboot.\n\n"); printf("Please press any key to reboot.\n\n");
cngetc(); cngetc();
} else {
if (howto & RB_DUMP) {
savectx(&dumppcb, 0);
dumppcb.pcb_cr3 = rcr3();
dumpsys();
}
doshutdownhooks();
} }
printf("rebooting...\n"); printf("rebooting...\n");
cpu_reset(); cpu_reset();
for(;;) ; for(;;) ;
@ -801,6 +805,9 @@ dumpsys()
int error = 0; int error = 0;
int c; int c;
/* Save registers. */
savectx(&dumppcb);
msgbufmapped = 0; /* don't record dump msgs in msgbuf */ msgbufmapped = 0; /* don't record dump msgs in msgbuf */
if (dumpdev == NODEV) if (dumpdev == NODEV)
return; return;