fixed compilation error with debugger enabled

- read PCI confAddr value from the devices code for debugger output
- PCI confData value isn't needed at all (changes by each read / write access)
- PCI framework methods don't need to be virtual
This commit is contained in:
Volker Ruppert 2012-11-09 13:30:52 +00:00
parent b63d835b30
commit ab57eb3615
4 changed files with 12 additions and 19 deletions

View File

@ -317,7 +317,6 @@ void bx_devices_c::reset(unsigned type)
#if BX_SUPPORT_PCI #if BX_SUPPORT_PCI
if (pci.enabled) { if (pci.enabled) {
pci.confAddr = 0; pci.confAddr = 0;
pci.confData = 0;
} }
#endif #endif
mem->disable_smram(); mem->disable_smram();
@ -328,9 +327,8 @@ void bx_devices_c::register_state()
{ {
#if BX_SUPPORT_PCI #if BX_SUPPORT_PCI
if (pci.enabled) { if (pci.enabled) {
bx_list_c *list = new bx_list_c(SIM->get_bochs_root(), "devices", "Generic PCI State"); bx_list_c *list = new bx_list_c(SIM->get_bochs_root(), "pcicore", "Generic PCI State");
BXRS_HEX_PARAM_FIELD(list, confAddr, pci.confAddr); BXRS_HEX_PARAM_FIELD(list, confAddr, pci.confAddr);
BXRS_HEX_PARAM_FIELD(list, confData, pci.confData);
} }
#endif #endif
bx_virt_timer.register_state(); bx_virt_timer.register_state();
@ -429,7 +427,6 @@ Bit32u bx_devices_c::read(Bit32u address, unsigned io_len)
} }
else else
retval = 0xFFFFFFFF; retval = 0xFFFFFFFF;
BX_DEV_THIS pci.confData = retval;
return retval; return retval;
} }
#endif #endif
@ -485,7 +482,6 @@ void bx_devices_c::write(Bit32u address, Bit32u value, unsigned io_len)
if ((io_len <= 4) && (handle < BX_MAX_PCI_DEVICES)) { if ((io_len <= 4) && (handle < BX_MAX_PCI_DEVICES)) {
if (((regnum>=4) && (regnum<=7)) || (regnum==12) || (regnum==13) || (regnum>14)) { if (((regnum>=4) && (regnum<=7)) || (regnum==12) || (regnum==13) || (regnum>14)) {
BX_DEV_THIS pci.pci_handler[handle].handler->pci_write_handler(regnum, value, io_len); BX_DEV_THIS pci.pci_handler[handle].handler->pci_write_handler(regnum, value, io_len);
BX_DEV_THIS pci.confData = value << (8 * (address & 0x03));
} }
else else
BX_DEBUG(("read only register, write ignored")); BX_DEBUG(("read only register, write ignored"));

View File

@ -422,18 +422,16 @@ public:
void mouse_enabled_changed(bx_bool enabled); void mouse_enabled_changed(bx_bool enabled);
void mouse_motion(int delta_x, int delta_y, int delta_z, unsigned button_state, bx_bool absxy); void mouse_motion(int delta_x, int delta_y, int delta_z, unsigned button_state, bx_bool absxy);
virtual bx_bool is_pci_device(const char *name); bx_bool is_pci_device(const char *name);
#if BX_SUPPORT_PCI #if BX_SUPPORT_PCI
virtual bx_bool register_pci_handlers(bx_pci_device_stub_c *device, Bit32u pci_get_confAddr(void) {return pci.confAddr;}
Bit8u *devfunc, const char *name, bx_bool register_pci_handlers(bx_pci_device_stub_c *device, Bit8u *devfunc,
const char *descr); const char *name, const char *descr);
virtual bx_bool pci_set_base_mem(void *this_ptr, memory_handler_t f1, bx_bool pci_set_base_mem(void *this_ptr, memory_handler_t f1, memory_handler_t f2,
memory_handler_t f2, Bit32u *addr, Bit32u *addr, Bit8u *pci_conf, unsigned size);
Bit8u *pci_conf, unsigned size); bx_bool pci_set_base_io(void *this_ptr, bx_read_handler_t f1, bx_write_handler_t f2,
virtual bx_bool pci_set_base_io(void *this_ptr, bx_read_handler_t f1, Bit32u *addr, Bit8u *pci_conf, unsigned size,
bx_write_handler_t f2, Bit32u *addr, const Bit8u *iomask, const char *name);
Bit8u *pci_conf, unsigned size,
const Bit8u *iomask, const char *name);
#endif #endif
static void timer_handler(void *); static void timer_handler(void *);
@ -571,7 +569,6 @@ private:
bx_bool slot_used[BX_N_PCI_SLOTS]; bx_bool slot_used[BX_N_PCI_SLOTS];
Bit32u confAddr; Bit32u confAddr;
Bit32u confData;
#endif #endif
} pci; } pci;

View File

@ -250,8 +250,7 @@ void bx_pci_bridge_c::debug_dump(int argc, char **argv)
int arg, i, j, r; int arg, i, j, r;
dbg_printf("i440FX PMC/DBX\n\n"); dbg_printf("i440FX PMC/DBX\n\n");
dbg_printf("confAddr = 0x%08x\n", BX_PCI_THIS confAddr); dbg_printf("confAddr = 0x%08x\n\n", DEV_pci_get_confAddr());
dbg_printf("confData = 0x%08x\n", BX_PCI_THIS confData);
if (argc == 0) { if (argc == 0) {
for (i = 0x59; i < 0x60; i++) { for (i = 0x59; i < 0x60; i++) {

View File

@ -224,6 +224,7 @@ extern "C" {
#define DEV_register_pci_handlers(a,b,c,d) \ #define DEV_register_pci_handlers(a,b,c,d) \
(bx_devices.register_pci_handlers(a,b,c,d)) (bx_devices.register_pci_handlers(a,b,c,d))
#define DEV_is_pci_device(name) bx_devices.is_pci_device(name) #define DEV_is_pci_device(name) bx_devices.is_pci_device(name)
#define DEV_pci_get_confAddr() bx_devices.pci_get_confAddr()
#define DEV_pci_set_irq(a,b,c) bx_devices.pluginPci2IsaBridge->pci_set_irq(a,b,c) #define DEV_pci_set_irq(a,b,c) bx_devices.pluginPci2IsaBridge->pci_set_irq(a,b,c)
#define DEV_pci_set_base_mem(a,b,c,d,e,f) \ #define DEV_pci_set_base_mem(a,b,c,d,e,f) \
(bx_devices.pci_set_base_mem(a,b,c,d,e,f)) (bx_devices.pci_set_base_mem(a,b,c,d,e,f))