From 48ed7e1ba64864433b3dfccbda48b0cfc3d1f0db Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Sat, 23 Sep 2006 09:07:15 +0000 Subject: [PATCH] - fixes for second simulation support with wxBochs * wxBochsStopSim flag is now reset before starting the SimThread * the siminterface 'init_done' flag now controls the execution of the hardware cleanup in bx_atexit() --- bochs/gui/wxmain.cc | 3 ++- bochs/main.cc | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bochs/gui/wxmain.cc b/bochs/gui/wxmain.cc index 3b26179b2..efb73735a 100644 --- a/bochs/gui/wxmain.cc +++ b/bochs/gui/wxmain.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////// -// $Id: wxmain.cc,v 1.149 2006-09-17 07:12:50 vruppert Exp $ +// $Id: wxmain.cc,v 1.150 2006-09-23 09:07:15 vruppert Exp $ ///////////////////////////////////////////////////////////////// // // wxmain.cc implements the wxWidgets frame, toolbar, menus, and dialogs. @@ -1051,6 +1051,7 @@ void MyFrame::OnStartSim(wxCommandEvent& event) wxT("2nd time warning"), wxOK | wxICON_WARNING, this); } num_events = 0; // clear the queue of events for bochs to handle + wxBochsStopSim = false; sim_thread = new SimThread(this); sim_thread->Create(); sim_thread->Run(); diff --git a/bochs/main.cc b/bochs/main.cc index 149962b66..ac41797df 100644 --- a/bochs/main.cc +++ b/bochs/main.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: main.cc,v 1.344 2006-09-20 17:02:19 sshwarts Exp $ +// $Id: main.cc,v 1.345 2006-09-23 09:07:15 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -1130,9 +1130,7 @@ void bx_init_bx_dbg(void) int bx_atexit(void) { - static bx_bool been_here = 0; - if (been_here) return 1; // protect from reentry - been_here = 1; + if (!SIM->get_init_done()) return 1; // protect from reentry // in case we ended up in simulation mode, change back to config mode // so that the user can see any messages left behind on the console. @@ -1163,6 +1161,8 @@ int bx_atexit(void) #endif #endif + SIM->set_init_done(0); + return 0; }