Use reset port before clearing page table in cpu_reset if PC98 is

defined.  Clearing page table could hang some new PC-98.
This commit is contained in:
KATO Takenori 1997-04-16 12:11:37 +00:00
parent 9453d60b10
commit 03245f094d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24980
2 changed files with 24 additions and 20 deletions

View File

@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
* $Id: vm_machdep.c,v 1.77 1997/03/29 04:35:26 bde Exp $
* $Id: vm_machdep.c,v 1.78 1997/04/07 07:15:56 peter Exp $
*/
#include "npx.h"
@ -788,32 +788,34 @@ vunmapbuf(bp)
*/
void
cpu_reset() {
#ifdef PC98
/*
* Attempt to do a CPU reset via CPU reset port.
*/
asm("cli");
outb(0x37, 0x0f); /* SHUT0 = 0. */
outb(0x37, 0x0b); /* SHUT1 = 0. */
outb(0xf0, 0x00); /* Reset. */
#else
/*
* Attempt to do a CPU reset via the keyboard controller,
* do not turn of the GateA20, as any machine that fails
* to do the reset here would then end up in no man's land.
*/
#if !defined(BROKEN_KEYBOARD_RESET) && !defined(PC98)
#if !defined(BROKEN_KEYBOARD_RESET)
outb(IO_KBD + 4, 0xFE);
DELAY(500000); /* wait 0.5 sec to see if that did it */
printf("Keyboard reset did not work, attempting CPU shutdown\n");
DELAY(1000000); /* wait 1 sec for printf to complete */
#endif
#endif /* PC98 */
/* force a shutdown by unmapping entire address space ! */
bzero((caddr_t) PTD, PAGE_SIZE);
/* "good night, sweet prince .... <THUNK!>" */
invltlb();
/* NOTREACHED */
#ifdef PC98
asm(" cli ");
outb(0x37, 0x0f); /* SHUT 0 = 0 */
outb(0x37, 0x0b); /* SHUT 1 = 0 */
outb(0xf0, 0x00); /* reset port */
#endif
while(1);
}

View File

@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
* $Id: vm_machdep.c,v 1.77 1997/03/29 04:35:26 bde Exp $
* $Id: vm_machdep.c,v 1.78 1997/04/07 07:15:56 peter Exp $
*/
#include "npx.h"
@ -788,32 +788,34 @@ vunmapbuf(bp)
*/
void
cpu_reset() {
#ifdef PC98
/*
* Attempt to do a CPU reset via CPU reset port.
*/
asm("cli");
outb(0x37, 0x0f); /* SHUT0 = 0. */
outb(0x37, 0x0b); /* SHUT1 = 0. */
outb(0xf0, 0x00); /* Reset. */
#else
/*
* Attempt to do a CPU reset via the keyboard controller,
* do not turn of the GateA20, as any machine that fails
* to do the reset here would then end up in no man's land.
*/
#if !defined(BROKEN_KEYBOARD_RESET) && !defined(PC98)
#if !defined(BROKEN_KEYBOARD_RESET)
outb(IO_KBD + 4, 0xFE);
DELAY(500000); /* wait 0.5 sec to see if that did it */
printf("Keyboard reset did not work, attempting CPU shutdown\n");
DELAY(1000000); /* wait 1 sec for printf to complete */
#endif
#endif /* PC98 */
/* force a shutdown by unmapping entire address space ! */
bzero((caddr_t) PTD, PAGE_SIZE);
/* "good night, sweet prince .... <THUNK!>" */
invltlb();
/* NOTREACHED */
#ifdef PC98
asm(" cli ");
outb(0x37, 0x0f); /* SHUT 0 = 0 */
outb(0x37, 0x0b); /* SHUT 1 = 0 */
outb(0xf0, 0x00); /* reset port */
#endif
while(1);
}