From 3104ba6bea5430b846983a65bd79d0f74963d8f2 Mon Sep 17 00:00:00 2001 From: Christophe Bothamy Date: Thu, 21 Nov 2002 08:08:29 +0000 Subject: [PATCH] - 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. --- bochs/cpu/cpu.cc | 4 ++-- bochs/cpu/init.cc | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bochs/cpu/cpu.cc b/bochs/cpu/cpu.cc index ccd0e4954..bbc960599 100644 --- a/bochs/cpu/cpu.cc +++ b/bochs/cpu/cpu.cc @@ -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; } diff --git a/bochs/cpu/init.cc b/bochs/cpu/init.cc index afe9f57fb..3b472b088 100644 --- a/bochs/cpu/init.cc +++ b/bochs/cpu/init.cc @@ -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;