THe ACPI device can use the base class pci_read_handler().

Minor other PCI code changes.
This commit is contained in:
Volker Ruppert 2017-03-27 19:38:37 +00:00
parent e5c64b3b56
commit 4bbed47b5d
4 changed files with 6 additions and 25 deletions

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2006-2017 Volker Ruppert
// Copyright (C) 2006-2017 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -473,25 +473,6 @@ void bx_acpi_ctrl_c::timer()
BX_ACPI_THIS pm_update_sci();
}
// pci configuration space read callback handler
Bit32u bx_acpi_ctrl_c::pci_read_handler(Bit8u address, unsigned io_len)
{
Bit32u value = 0;
for (unsigned i=0; i<io_len; i++) {
value |= (BX_ACPI_THIS pci_conf[address+i] << (i*8));
}
if (io_len == 1)
BX_DEBUG(("read PCI register 0x%02x value 0x%02x", address, value));
else if (io_len == 2)
BX_DEBUG(("read PCI register 0x%02x value 0x%04x", address, value));
else if (io_len == 4)
BX_DEBUG(("read PCI register 0x%02x value 0x%08x", address, value));
return value;
}
// static pci configuration space write callback handler
void bx_acpi_ctrl_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2006 Volker Ruppert
// Copyright (C) 2006-2017 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -42,8 +42,7 @@ public:
virtual void register_state(void);
virtual void after_restore_state(void);
virtual Bit32u pci_read_handler(Bit8u address, unsigned io_len);
virtual void pci_write_handler(Bit8u address, Bit32u value, unsigned io_len);
virtual void pci_write_handler(Bit8u address, Bit32u value, unsigned io_len);
static Bit32u read_handler(void *this_ptr, Bit32u address, unsigned io_len);
static void write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len);

View File

@ -1221,6 +1221,7 @@ void bx_pci_device_c::load_pci_rom(const char *path)
BX_INFO(("loaded PCI ROM '%s' (size=%u / PCI=%uk)", path, (unsigned) stat_buf.st_size, pci_rom_size >> 10));
}
// pci configuration space read callback handler
Bit32u bx_pci_device_c::pci_read_handler(Bit8u address, unsigned io_len)
{
Bit32u value = 0;

View File

@ -360,7 +360,7 @@ Bit32u bx_pci_ide_c::read(Bit32u address, unsigned io_len)
break;
case 0x04:
value = BX_PIDE_THIS s.bmdma[channel].dtpr;
BX_DEBUG(("BM-DMA read DTP register, channel %d, value = 0x%04x", channel, value));
BX_DEBUG(("BM-DMA read DTP register, channel %d, value = 0x%08x", channel, value));
break;
}
@ -414,7 +414,7 @@ void bx_pci_ide_c::write(Bit32u address, Bit32u value, unsigned io_len)
break;
case 0x04:
BX_PIDE_THIS s.bmdma[channel].dtpr = value & 0xfffffffc;
BX_DEBUG(("BM-DMA write DTP register, channel %d, value = 0x%04x", channel, value));
BX_DEBUG(("BM-DMA write DTP register, channel %d, value = 0x%08x", channel, value));
break;
}
}