Further improved version of hadling a HALT when there is no console.
This commit is contained in:
parent
7860637efd
commit
d13d3630fd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19274
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
||||
* $Id: machdep.c,v 1.207 1996/10/05 10:44:03 jkh Exp $
|
||||
* $Id: machdep.c,v 1.208 1996/10/20 18:35:32 phk Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
@ -689,6 +689,16 @@ cpu_boot(int howto)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Shutdown the CPU as much as possible
|
||||
*/
|
||||
void
|
||||
cpu_halt(void)
|
||||
{
|
||||
for (;;)
|
||||
__asm__ ("hlt");
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear registers on exec
|
||||
*/
|
||||
|
@ -26,7 +26,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: md_var.h,v 1.8 1996/03/02 19:37:45 peter Exp $
|
||||
* $Id: md_var.h,v 1.9 1996/07/01 18:12:24 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef _MACHINE_MD_VAR_H_
|
||||
@ -55,6 +55,7 @@ struct reg;
|
||||
|
||||
void bcopyb __P((const void *from, void *to, size_t len));
|
||||
void cpu_reset __P((void));
|
||||
void cpu_halt __P((void));
|
||||
void doreti_iret __P((void)) __asm(__STRING(doreti_iret));
|
||||
void doreti_iret_fault __P((void)) __asm(__STRING(doreti_iret_fault));
|
||||
void doreti_popl_ds __P((void)) __asm(__STRING(doreti_popl_ds));
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
||||
* $Id: machdep.c,v 1.207 1996/10/05 10:44:03 jkh Exp $
|
||||
* $Id: machdep.c,v 1.208 1996/10/20 18:35:32 phk Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
@ -689,6 +689,16 @@ cpu_boot(int howto)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Shutdown the CPU as much as possible
|
||||
*/
|
||||
void
|
||||
cpu_halt(void)
|
||||
{
|
||||
for (;;)
|
||||
__asm__ ("hlt");
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear registers on exec
|
||||
*/
|
||||
|
@ -26,7 +26,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: md_var.h,v 1.8 1996/03/02 19:37:45 peter Exp $
|
||||
* $Id: md_var.h,v 1.9 1996/07/01 18:12:24 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef _MACHINE_MD_VAR_H_
|
||||
@ -55,6 +55,7 @@ struct reg;
|
||||
|
||||
void bcopyb __P((const void *from, void *to, size_t len));
|
||||
void cpu_reset __P((void));
|
||||
void cpu_halt __P((void));
|
||||
void doreti_iret __P((void)) __asm(__STRING(doreti_iret));
|
||||
void doreti_iret_fault __P((void)) __asm(__STRING(doreti_iret_fault));
|
||||
void doreti_popl_ds __P((void)) __asm(__STRING(doreti_popl_ds));
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94
|
||||
* $Id: kern_shutdown.c,v 1.8 1996/09/14 04:31:01 bde Exp $
|
||||
* $Id: kern_shutdown.c,v 1.9 1996/10/30 21:40:22 julian Exp $
|
||||
*/
|
||||
|
||||
#include "opt_ddb.h"
|
||||
@ -229,7 +229,13 @@ boot(howto)
|
||||
printf("\n");
|
||||
printf("The operating system has halted.\n");
|
||||
printf("Please press any key to reboot.\n\n");
|
||||
while (cngetc() == -1); /* no console, halt means STOP HERE */
|
||||
switch (cngetc()) {
|
||||
case -1: /* No console, just die */
|
||||
cpu_halt();
|
||||
/* NOTREACHED */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (howto & RB_DUMP) {
|
||||
if (!cold) {
|
||||
|
Loading…
Reference in New Issue
Block a user