- 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()
This commit is contained in:
Volker Ruppert 2006-09-23 09:07:15 +00:00
parent e315eb0fa6
commit 48ed7e1ba6
2 changed files with 6 additions and 5 deletions

View File

@ -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();

View File

@ -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;
}