Change boot() to honour "always halt" flags in boothowto,
other boot() changes modelled on arch/alpha/alpha/machdep.c.
This commit is contained in:
parent
17f5b2a175
commit
8ab94387e9
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: machdep.c,v 1.62 1996/10/13 03:39:50 christos Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.63 1996/10/13 04:26:49 jonathan Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -227,6 +227,9 @@ volatile u_int *Mach_reset_addr;
|
|||
#endif /* DS5000_200 || DS5000_25 || DS5000_100 || DS5000_240 */
|
||||
|
||||
|
||||
void prom_halt __P((int, char *)) __attribute__((__noreturn__));
|
||||
|
||||
|
||||
/*
|
||||
* safepri is a safe priority for sleep to set for a spin-wait
|
||||
* during autoconfiguration or after a panic.
|
||||
|
@ -1123,6 +1126,9 @@ dumpsys()
|
|||
{
|
||||
int error;
|
||||
|
||||
/* Save registers. */
|
||||
savectx(&dumppcb, 0);
|
||||
|
||||
msgbufmapped = 0;
|
||||
if (dumpdev == NODEV)
|
||||
return;
|
||||
|
@ -1169,10 +1175,11 @@ dumpsys()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* call PROM to halt or reboot.
|
||||
*/
|
||||
void
|
||||
volatile void
|
||||
prom_halt(howto, bootstr)
|
||||
int howto;
|
||||
char *bootstr;
|
||||
|
@ -1219,13 +1226,17 @@ boot(howto, bootstr)
|
|||
goto haltsys;
|
||||
}
|
||||
|
||||
/* If "always halt" was specified as a boot flag, obey. */
|
||||
if ((boothowto & RB_HALT) != 0)
|
||||
howto |= RB_HALT;
|
||||
|
||||
boothowto = howto;
|
||||
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
|
||||
/*
|
||||
* Synchronize the disks....
|
||||
*/
|
||||
waittime = 0;
|
||||
vfs_shutdown ();
|
||||
vfs_shutdown();
|
||||
|
||||
/*
|
||||
* If we've been adjusting the clock, the todr
|
||||
|
@ -1234,14 +1245,16 @@ boot(howto, bootstr)
|
|||
resettodr();
|
||||
}
|
||||
|
||||
/* disable interrupts. */
|
||||
(void) splhigh(); /* extreme priority */
|
||||
/* Disable interrupts. */
|
||||
splhigh();
|
||||
|
||||
/* If rebooting and a dump is requested do it. */
|
||||
if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP) {
|
||||
savectx(&dumppcb, 0);
|
||||
#if 0
|
||||
if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP)
|
||||
#else
|
||||
if (howto & RB_DUMP)
|
||||
#endif
|
||||
dumpsys();
|
||||
}
|
||||
|
||||
/* run any shutdown hooks */
|
||||
doshutdownhooks();
|
||||
|
@ -1251,13 +1264,10 @@ haltsys:
|
|||
/* Finally, halt/reboot the system. */
|
||||
printf("%s\n\n", howto & RB_HALT ? "halted." : "rebooting...");
|
||||
prom_halt(howto & RB_HALT, bootstr);
|
||||
|
||||
while(1) ; /* fool gcc */
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Read a high-resolution clock, if one is available, and return
|
||||
* the current microsecond offset from time-of-day.
|
||||
|
|
Loading…
Reference in New Issue