- added port 0x8900 to enable bochs programmatic shutdown

This commit is contained in:
Christophe Bothamy 2002-07-29 12:44:47 +00:00
parent 52007ee6c7
commit 5e15db2dcd
2 changed files with 22 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: unmapped.cc,v 1.15 2002-04-01 21:53:23 cbothamy Exp $
// $Id: unmapped.cc,v 1.16 2002-07-29 12:44:47 cbothamy Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -237,6 +237,25 @@ bx_unmapped_c::write(Bit32u address, Bit32u value, unsigned io_len)
// address, value));
break;
case 0x8900: // Shutdown port, could be moved in a PM device
// or a host <-> guest communication device
switch (value) {
case 'S': if (BX_UM_THIS s.shutdown == 0) BX_UM_THIS s.shutdown = 1; break;
case 'h': if (BX_UM_THIS s.shutdown == 1) BX_UM_THIS s.shutdown = 2; break;
case 'u': if (BX_UM_THIS s.shutdown == 2) BX_UM_THIS s.shutdown = 3; break;
case 't': if (BX_UM_THIS s.shutdown == 3) BX_UM_THIS s.shutdown = 4; break;
case 'd': if (BX_UM_THIS s.shutdown == 4) BX_UM_THIS s.shutdown = 5; break;
case 'o': if (BX_UM_THIS s.shutdown == 5) BX_UM_THIS s.shutdown = 6; break;
case 'w': if (BX_UM_THIS s.shutdown == 6) BX_UM_THIS s.shutdown = 7; break;
case 'n': if (BX_UM_THIS s.shutdown == 7) BX_UM_THIS s.shutdown = 8; break;
default : BX_UM_THIS s.shutdown = 0; break;
}
if (BX_UM_THIS s.shutdown == 8) {
BX_INFO(("Shutdown port: shutdown requested"));
BX_CPU(0)->kill_bochs_request = 2;
}
break;
case 0xfedc:
bx_dbg.debugger = (value > 0);
BX_DEBUG(( "DEBUGGER = %u", (unsigned) bx_dbg.debugger));

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: unmapped.h,v 1.7 2002-04-01 21:57:51 cbothamy Exp $
// $Id: unmapped.h,v 1.8 2002-07-29 12:44:47 cbothamy Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -55,6 +55,7 @@ private:
struct {
Bit8u port80;
Bit8u port8e;
Bit8u shutdown;
} s; // state information
bx_devices_c *devices;