- fix [ 625878 ] reset doesn't reset something(?)

In bx_cpu_c::reset method I set bx_cpu->async_event to 2
  so execution in the cpu_loop gets stopped early.

  Previously, async_event was set to 0, and with repeatable
  instructions, after reset, eip was incremented by the instruction
  length, so execution would resume at 0xffffX (X being >0, the current
  instruction length).

  In halt state I check now for reset with async_event is 2, so
  reset works also when the cpu is halted. (update to Peter change)

  I hope I fixed this the right way, please report any strange behaviour.
This commit is contained in:
Christophe Bothamy 2002-11-21 08:08:29 +00:00
parent c991f50191
commit 3104ba6bea
2 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.cc,v 1.70 2002-11-04 05:27:25 ptrumpet Exp $
// $Id: cpu.cc,v 1.71 2002-11-21 08:08:29 cbothamy Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -515,7 +515,7 @@ BX_CPU_C::handleAsyncEvent(void)
if (BX_CPU_INTR && BX_CPU_THIS_PTR get_IF ()) {
break;
}
if (BX_CPU_THIS_PTR async_event == 0) {
if (BX_CPU_THIS_PTR async_event == 2) {
BX_INFO(("decode: reset detected in halt state"));
break;
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: init.cc,v 1.42 2002-11-19 05:52:52 bdenney Exp $
// $Id: init.cc,v 1.43 2002-11-21 08:08:29 cbothamy Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -168,7 +168,7 @@ cpu_param_handler (bx_param_c *param, int set, Bit64s val)
void BX_CPU_C::init(BX_MEM_C *addrspace)
{
BX_DEBUG(( "Init $Id: init.cc,v 1.42 2002-11-19 05:52:52 bdenney Exp $"));
BX_DEBUG(( "Init $Id: init.cc,v 1.43 2002-11-21 08:08:29 cbothamy Exp $"));
// BX_CPU_C constructor
BX_CPU_THIS_PTR set_INTR (0);
#if BX_SUPPORT_APIC
@ -877,7 +877,7 @@ BX_CPU_C::reset(unsigned source)
async_event = 1;
}
#else
BX_CPU_THIS_PTR async_event = 0;
BX_CPU_THIS_PTR async_event=2;
#endif
BX_CPU_THIS_PTR kill_bochs_request = 0;