From 78513089e44dd8c3343f5da5d36b740e1aa7e34d Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Mon, 20 Aug 2012 07:35:30 +0000 Subject: [PATCH] - fixed unloading of support plugins - TODO: reorganize plugin types, since there are now 3 subtypes of core plugins (gui, core devices and support for networking, sound, usb) --- bochs/iodev/devices.cc | 15 +++++++++------ bochs/iodev/iodev.h | 4 ++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/bochs/iodev/devices.cc b/bochs/iodev/devices.cc index 3631c33ef..8841c7d4d 100644 --- a/bochs/iodev/devices.cc +++ b/bochs/iodev/devices.cc @@ -162,11 +162,13 @@ void bx_devices_c::init(BX_MEM_C *newmem) // PLUG_load_plugin(hdimage, PLUGTYPE_CORE); #if BX_NETWORKING - if (is_network_enabled()) + network_enabled = is_network_enabled(); + if (network_enabled) PLUG_load_plugin(netmod, PLUGTYPE_CORE); #endif #if BX_SUPPORT_SOUNDLOW - if (is_sound_enabled()) + sound_enabled = is_sound_enabled(); + if (sound_enabled) PLUG_load_plugin(soundmod, PLUGTYPE_CORE); #endif // PCI logic (i440FX) @@ -175,7 +177,8 @@ void bx_devices_c::init(BX_MEM_C *newmem) PLUG_load_plugin(pci, PLUGTYPE_CORE); PLUG_load_plugin(pci2isa, PLUGTYPE_CORE); #if BX_SUPPORT_PCIUSB - if (is_usb_enabled()) + usb_enabled = is_usb_enabled(); + if (usb_enabled) PLUG_load_plugin(usb_common, PLUGTYPE_CORE); #endif PLUG_load_plugin(acpi, PLUGTYPE_STANDARD); @@ -316,15 +319,15 @@ void bx_devices_c::exit() bx_unload_core_plugins(); PLUG_unload_plugin(hdimage); #if BX_NETWORKING - if (is_network_enabled()) + if (network_enabled) PLUG_unload_plugin(netmod); #endif #if BX_SUPPORT_SOUNDLOW - if (is_sound_enabled()) + if (sound_enabled) PLUG_unload_plugin(soundmod); #endif #if BX_SUPPORT_PCIUSB - if (is_usb_enabled()) + if (usb_enabled) PLUG_unload_plugin(usb_common); #endif init_stubs(); diff --git a/bochs/iodev/iodev.h b/bochs/iodev/iodev.h index 1ed20b6cb..c6099992a 100644 --- a/bochs/iodev/iodev.h +++ b/bochs/iodev/iodev.h @@ -581,6 +581,10 @@ private: int timer_handle; + bx_bool network_enabled; + bx_bool sound_enabled; + bx_bool usb_enabled; + bx_bool is_harddrv_enabled(); bx_bool is_network_enabled(); bx_bool is_sound_enabled();