- 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:
parent
c991f50191
commit
3104ba6bea
@ -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.
|
// 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 ()) {
|
if (BX_CPU_INTR && BX_CPU_THIS_PTR get_IF ()) {
|
||||||
break;
|
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"));
|
BX_INFO(("decode: reset detected in halt state"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -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.
|
// 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)
|
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_C constructor
|
||||||
BX_CPU_THIS_PTR set_INTR (0);
|
BX_CPU_THIS_PTR set_INTR (0);
|
||||||
#if BX_SUPPORT_APIC
|
#if BX_SUPPORT_APIC
|
||||||
@ -877,7 +877,7 @@ BX_CPU_C::reset(unsigned source)
|
|||||||
async_event = 1;
|
async_event = 1;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
BX_CPU_THIS_PTR async_event = 0;
|
BX_CPU_THIS_PTR async_event=2;
|
||||||
#endif
|
#endif
|
||||||
BX_CPU_THIS_PTR kill_bochs_request = 0;
|
BX_CPU_THIS_PTR kill_bochs_request = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user