Some work on the PCI devices code.
- Since the pci_read_handler() method is identical in most devices, move it to the base class to reduce code duplication. Only the 'pcidev' device has it's own implementation (NOTE: it is not maintained yet). - Minor other fixes and cleanups in some PCI devices.
This commit is contained in:
parent
bc1b1d4ed5
commit
d46a9b7205
@ -1217,6 +1217,24 @@ void bx_pci_device_stub_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));
|
||||
}
|
||||
|
||||
Bit32u bx_pci_device_stub_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
{
|
||||
Bit32u value = 0;
|
||||
|
||||
for (unsigned i=0; i<io_len; i++) {
|
||||
value |= (pci_conf[address+i] << (i*8));
|
||||
}
|
||||
|
||||
if (io_len == 1)
|
||||
BX_DEBUG(("read PCI register 0x%02X value 0x%02X (len=1)", address, value));
|
||||
else if (io_len == 2)
|
||||
BX_DEBUG(("read PCI register 0x%02X value 0x%04X (len=2)", address, value));
|
||||
else if (io_len == 4)
|
||||
BX_DEBUG(("read PCI register 0x%02X value 0x%08X (len=4)", address, value));
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
#if BX_SUPPORT_PCI
|
||||
bx_bool bx_devices_c::register_pci_handlers(bx_pci_device_stub_c *dev,
|
||||
Bit8u *devfunc, const char *name,
|
||||
|
@ -2379,19 +2379,6 @@ void bx_svga_cirrus_c::svga_init_pcihandlers(void)
|
||||
BX_CIRRUS_THIS load_pci_rom(SIM->get_param_string(BXPN_VGA_ROM_PATH)->getptr());
|
||||
}
|
||||
|
||||
Bit32u bx_svga_cirrus_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
{
|
||||
Bit32u ret = 0;
|
||||
for (unsigned i = 0; i < io_len; i++) {
|
||||
ret |= (Bit32u)(BX_CIRRUS_THIS pci_conf[address + i]) << (i*8);
|
||||
}
|
||||
|
||||
BX_DEBUG(("pci_read: address 0x%02x, io_len 0x%02x, value 0x%x",
|
||||
(unsigned)address, (unsigned)io_len, (unsigned)ret));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void bx_svga_cirrus_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
{
|
||||
unsigned i;
|
||||
|
@ -5,7 +5,7 @@
|
||||
// Copyright (c) 2004 Makoto Suzuki (suzu)
|
||||
// Volker Ruppert (vruppert)
|
||||
// Robin Kay (komadori)
|
||||
// Copyright (C) 2004-2013 The Bochs Project
|
||||
// Copyright (C) 2004-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
|
||||
@ -81,11 +81,10 @@ public:
|
||||
virtual void after_restore_state(void);
|
||||
|
||||
#if BX_SUPPORT_PCI
|
||||
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);
|
||||
#endif
|
||||
#if BX_DEBUGGER
|
||||
virtual void debug_dump(int argc, char **argv);
|
||||
virtual void debug_dump(int argc, char **argv);
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
@ -1355,26 +1355,6 @@ Bit32u bx_vga_c::vbe_write(Bit32u address, Bit32u value, unsigned io_len)
|
||||
}
|
||||
|
||||
#if BX_SUPPORT_PCI
|
||||
// pci configuration space read callback handler
|
||||
Bit32u bx_vga_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
{
|
||||
Bit32u value = 0;
|
||||
|
||||
for (unsigned i=0; i<io_len; i++) {
|
||||
value |= (BX_VGA_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_vga_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002-2012 The Bochs Project
|
||||
// Copyright (C) 2002-2017 The Bochs Project
|
||||
// PCI VGA dummy adapter Copyright (C) 2002,2003 Mike Nordell
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
@ -113,11 +113,10 @@ public:
|
||||
#endif
|
||||
|
||||
#if BX_SUPPORT_PCI
|
||||
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);
|
||||
#endif
|
||||
#if BX_DEBUGGER
|
||||
virtual void debug_dump(int argc, char **argv);
|
||||
virtual void debug_dump(int argc, char **argv);
|
||||
#endif
|
||||
|
||||
static Bit64s vga_param_handler(bx_param_c *param, int set, Bit64s val);
|
||||
|
@ -614,26 +614,6 @@ void bx_voodoo_c::set_irq_level(bx_bool level)
|
||||
}
|
||||
|
||||
|
||||
// pci configuration space read callback handler
|
||||
Bit32u bx_voodoo_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
{
|
||||
Bit32u value = 0;
|
||||
|
||||
for (unsigned i=0; i<io_len; i++) {
|
||||
value |= (BX_VOODOO_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;
|
||||
}
|
||||
|
||||
|
||||
// pci configuration space write callback handler
|
||||
void bx_voodoo_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2012-2014 The Bochs Project
|
||||
// Copyright (C) 2012-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
|
||||
@ -56,8 +56,7 @@ public:
|
||||
virtual void redraw_area(unsigned x0, unsigned y0,
|
||||
unsigned width, unsigned height);
|
||||
|
||||
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 Bit16u get_retrace(void);
|
||||
static void output_enable(bx_bool enabled);
|
||||
|
@ -95,10 +95,7 @@ public:
|
||||
if (pci_rom != NULL) delete [] pci_rom;
|
||||
}
|
||||
|
||||
virtual Bit32u pci_read_handler(Bit8u address, unsigned io_len) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual Bit32u pci_read_handler(Bit8u address, unsigned io_len);
|
||||
virtual void pci_write_handler(Bit8u address, Bit32u value, unsigned io_len) {}
|
||||
|
||||
void init_pci_conf(Bit16u vid, Bit16u did, Bit8u rev, Bit32u classc, Bit8u headt);
|
||||
|
@ -1477,26 +1477,6 @@ void bx_e1000_c::rx_frame(const void *buf, unsigned buf_size)
|
||||
}
|
||||
|
||||
|
||||
// pci configuration space read callback handler
|
||||
Bit32u bx_e1000_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
{
|
||||
Bit32u value = 0;
|
||||
|
||||
for (unsigned i=0; i<io_len; i++) {
|
||||
value |= (BX_E1000_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;
|
||||
}
|
||||
|
||||
|
||||
// pci configuration space write callback handler
|
||||
void bx_e1000_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
{
|
||||
|
@ -12,7 +12,7 @@
|
||||
// Copyright (c) 2007 Dan Aloni
|
||||
// Copyright (c) 2004 Antony T Curtis
|
||||
//
|
||||
// Copyright (C) 2011 The Bochs Project
|
||||
// Copyright (C) 2011-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
|
||||
@ -122,8 +122,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);
|
||||
|
||||
private:
|
||||
bx_e1000_t s;
|
||||
|
@ -1695,19 +1695,6 @@ void bx_ne2k_c::set_irq_level(bx_bool level)
|
||||
}
|
||||
|
||||
#if BX_SUPPORT_PCI
|
||||
|
||||
// pci configuration space read callback handler
|
||||
Bit32u bx_ne2k_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
{
|
||||
Bit32u value = 0;
|
||||
|
||||
for (unsigned i=0; i<io_len; i++) {
|
||||
value |= (BX_NE2K_THIS pci_conf[address+i] << (i*8));
|
||||
}
|
||||
BX_DEBUG(("NE2000 PCI NIC read register 0x%02x value 0x%08x", address, value));
|
||||
return value;
|
||||
}
|
||||
|
||||
// pci configuration space write callback handler
|
||||
void bx_ne2k_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
{
|
||||
@ -1780,7 +1767,6 @@ void bx_ne2k_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
else if (io_len == 4)
|
||||
BX_DEBUG(("write PCI register 0x%02x value 0x%08x", address, value));
|
||||
}
|
||||
|
||||
#endif /* BX_SUPPORT_PCI */
|
||||
|
||||
#if BX_DEBUGGER
|
||||
|
@ -2,7 +2,7 @@
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001-2012 The Bochs Project
|
||||
// Copyright (C) 2001-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
|
||||
@ -216,7 +216,6 @@ public:
|
||||
#endif
|
||||
|
||||
#if BX_SUPPORT_PCI
|
||||
virtual Bit32u pci_read_handler(Bit8u address, unsigned io_len);
|
||||
virtual void pci_write_handler(Bit8u address, Bit32u value, unsigned io_len);
|
||||
#endif
|
||||
|
||||
|
@ -398,26 +398,6 @@ void bx_pcipnic_c::pnic_timer_handler(void *this_ptr)
|
||||
void bx_pcipnic_c::pnic_timer(void)
|
||||
{
|
||||
// Do nothing atm
|
||||
|
||||
}
|
||||
|
||||
// pci configuration space read callback handler
|
||||
Bit32u bx_pcipnic_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
{
|
||||
Bit32u value = 0;
|
||||
|
||||
for (unsigned i=0; i<io_len; i++) {
|
||||
value |= (BX_PNIC_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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
//
|
||||
// Copyright (C) 2003 Fen Systems Ltd.
|
||||
// http://www.fensystems.co.uk/
|
||||
// Copyright (C) 2003-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
|
||||
@ -68,7 +69,6 @@ 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);
|
||||
|
||||
private:
|
||||
|
@ -206,18 +206,6 @@ void bx_pci_bridge_c::after_restore_state(void)
|
||||
BX_PCI_THIS smram_control(BX_PCI_THIS pci_conf[0x72]);
|
||||
}
|
||||
|
||||
// pci configuration space read callback handler
|
||||
Bit32u bx_pci_bridge_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
{
|
||||
Bit32u value = 0;
|
||||
|
||||
for (unsigned i=0; i<io_len; i++) {
|
||||
value |= (BX_PCI_THIS pci_conf[address+i] << (i*8));
|
||||
}
|
||||
BX_DEBUG(("%s read register 0x%02x value 0x%08x", csname[BX_PCI_THIS chipset], address, value));
|
||||
return value;
|
||||
}
|
||||
|
||||
// pci configuration space write callback handler
|
||||
void bx_pci_bridge_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
{
|
||||
@ -318,7 +306,7 @@ void bx_pci_bridge_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io
|
||||
}
|
||||
break;
|
||||
case 0x72:
|
||||
smram_control(value); // SMRAM conrol register
|
||||
smram_control(value8); // SMRAM control register
|
||||
break;
|
||||
default:
|
||||
BX_PCI_THIS pci_conf[address+i] = value8;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002-2013 The Bochs Project
|
||||
// Copyright (C) 2002-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
|
||||
@ -45,8 +45,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);
|
||||
#if BX_DEBUGGER
|
||||
virtual void debug_dump(int argc, char **argv);
|
||||
#endif
|
||||
|
@ -342,18 +342,6 @@ void bx_piix3_c::write(Bit32u address, Bit32u value, unsigned io_len)
|
||||
}
|
||||
}
|
||||
|
||||
// pci configuration space read callback handler
|
||||
Bit32u bx_piix3_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
{
|
||||
Bit32u value = 0;
|
||||
|
||||
for (unsigned i=0; i<io_len; i++) {
|
||||
value |= (BX_P2I_THIS pci_conf[address+i] << (i*8));
|
||||
}
|
||||
BX_DEBUG(("PIIX3 PCI-to-ISA read register 0x%02x value 0x%08x", address, value));
|
||||
return value;
|
||||
}
|
||||
|
||||
// pci configuration space write callback handler
|
||||
void bx_piix3_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
{
|
||||
@ -384,7 +372,7 @@ void bx_piix3_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
BX_P2I_THIS pci_conf[address+i] = (oldval & ~value8) | 0x02;
|
||||
break;
|
||||
case 0x4e:
|
||||
if ((value & 0x04) != (oldval & 0x04)) {
|
||||
if ((value8 & 0x04) != (oldval & 0x04)) {
|
||||
DEV_mem_set_bios_write((value8 & 0x04) != 0);
|
||||
}
|
||||
BX_P2I_THIS pci_conf[address+i] = value8;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002-2015 The Bochs Project
|
||||
// Copyright (C) 2002-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
|
||||
@ -40,8 +40,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);
|
||||
#if BX_DEBUGGER
|
||||
virtual void debug_dump(int argc, char **argv);
|
||||
#endif
|
||||
|
@ -420,18 +420,6 @@ void bx_pci_ide_c::write(Bit32u address, Bit32u value, unsigned io_len)
|
||||
}
|
||||
|
||||
|
||||
// pci configuration space read callback handler
|
||||
Bit32u bx_pci_ide_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
{
|
||||
Bit32u value = 0;
|
||||
|
||||
for (unsigned i=0; i<io_len; i++) {
|
||||
value |= (BX_PIDE_THIS pci_conf[address+i] << (i*8));
|
||||
}
|
||||
BX_DEBUG(("PIIX3 PCI IDE read register 0x%02x value 0x%08x", address, value));
|
||||
return value;
|
||||
}
|
||||
|
||||
// pci configuration space write callback handler
|
||||
void bx_pci_ide_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2004-2014 The Bochs Project
|
||||
// Copyright (C) 2004-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
|
||||
@ -49,8 +49,7 @@ public:
|
||||
void param_restore(bx_param_c *param, Bit64s val);
|
||||
#endif
|
||||
|
||||
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 void timer_handler(void *);
|
||||
BX_PIDE_SMF void timer(void);
|
||||
|
@ -1087,25 +1087,6 @@ void bx_es1370_c::closemidioutput()
|
||||
}
|
||||
}
|
||||
|
||||
// pci configuration space read callback handler
|
||||
Bit32u bx_es1370_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
{
|
||||
Bit32u value = 0;
|
||||
|
||||
for (unsigned i=0; i<io_len; i++) {
|
||||
value |= (BX_ES1370_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;
|
||||
}
|
||||
|
||||
|
||||
// pci configuration space write callback handler
|
||||
void bx_es1370_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
|
@ -5,7 +5,7 @@
|
||||
// ES1370 soundcard support (ported from QEMU)
|
||||
//
|
||||
// Copyright (c) 2005 Vassili Karpov (malc)
|
||||
// Copyright (C) 2011-2015 The Bochs Project
|
||||
// Copyright (C) 2011-2017 The Bochs Project
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@ -91,8 +91,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);
|
||||
|
||||
// runtime options
|
||||
static Bit64s es1370_param_handler(bx_param_c *param, int set, Bit64s val);
|
||||
|
@ -3,7 +3,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009-2015 Benjamin D Lunt (fys [at] fysnet [dot] net)
|
||||
// 2009-2016 The Bochs Project
|
||||
// 2009-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
|
||||
@ -895,25 +895,6 @@ void bx_uhci_core_c::set_status(struct TD *td, bx_bool stalled, bx_bool data_buf
|
||||
td->dword1 &= ~((1<<28) | (1<<27)); // clear the c_err field in there was an error
|
||||
}
|
||||
|
||||
// pci configuration space read callback handler
|
||||
Bit32u bx_uhci_core_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
{
|
||||
Bit32u value = 0;
|
||||
|
||||
for (unsigned i=0; i<io_len; i++) {
|
||||
value |= (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;
|
||||
}
|
||||
|
||||
|
||||
// pci configuration space write callback handler
|
||||
void bx_uhci_core_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
|
@ -3,7 +3,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009-2016 Benjamin D Lunt (fys [at] fysnet [dot] net)
|
||||
// 2009-2016 The Bochs Project
|
||||
// 2009-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
|
||||
@ -179,8 +179,7 @@ public:
|
||||
virtual void register_state(bx_list_c *parent);
|
||||
virtual void after_restore_state(void);
|
||||
virtual void set_port_device(int port, usb_device_c *dev);
|
||||
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);
|
||||
|
||||
void event_handler(int event, USBPacket *packet, int port);
|
||||
|
||||
|
@ -2238,25 +2238,6 @@ void bx_usb_ehci_c::runtime_config(void)
|
||||
}
|
||||
}
|
||||
|
||||
// pci configuration space read callback handler
|
||||
Bit32u bx_usb_ehci_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
{
|
||||
Bit32u value = 0;
|
||||
|
||||
for (unsigned i=0; i<io_len; i++) {
|
||||
value |= (BX_EHCI_THIS pci_conf[address+i] << (i*8));
|
||||
}
|
||||
|
||||
if (io_len == 1)
|
||||
BX_DEBUG(("read PCI register 0x%02X value 0x%02X (len=1)", address, value));
|
||||
else if (io_len == 2)
|
||||
BX_DEBUG(("read PCI register 0x%02X value 0x%04X (len=2)", address, value));
|
||||
else if (io_len == 4)
|
||||
BX_DEBUG(("read PCI register 0x%02X value 0x%08X (len=4)", address, value));
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
// pci configuration space write callback handler
|
||||
void bx_usb_ehci_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
{
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
// Experimental USB EHCI adapter (partly ported from Qemu)
|
||||
//
|
||||
// Copyright (C) 2015-2016 The Bochs Project
|
||||
// Copyright (C) 2015-2017 The Bochs Project
|
||||
//
|
||||
// Copyright(c) 2008 Emutex Ltd. (address@hidden)
|
||||
// Copyright(c) 2011-2012 Red Hat, Inc.
|
||||
@ -330,8 +330,7 @@ public:
|
||||
virtual void reset(unsigned);
|
||||
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);
|
||||
|
||||
void event_handler(int event, USBPacket *packet, int port);
|
||||
|
||||
|
@ -1436,25 +1436,6 @@ void bx_usb_ohci_c::runtime_config(void)
|
||||
}
|
||||
}
|
||||
|
||||
// pci configuration space read callback handler
|
||||
Bit32u bx_usb_ohci_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
{
|
||||
Bit32u value = 0;
|
||||
|
||||
for (unsigned i=0; i<io_len; i++) {
|
||||
value |= (BX_OHCI_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;
|
||||
}
|
||||
|
||||
|
||||
// pci configuration space write callback handler
|
||||
void bx_usb_ohci_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
|
@ -3,7 +3,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009-2016 Benjamin D Lunt (fys [at] fysnet [dot] net)
|
||||
// 2009-2016 The Bochs Project
|
||||
// 2009-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
|
||||
@ -256,8 +256,8 @@ public:
|
||||
virtual void reset(unsigned);
|
||||
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);
|
||||
|
||||
void event_handler(int event, USBPacket *packet, int port);
|
||||
|
||||
|
@ -43,9 +43,6 @@
|
||||
|
||||
bx_usb_uhci_c* theUSB_UHCI = NULL;
|
||||
|
||||
const Bit8u uhci_iomask[32] = {2, 1, 2, 1, 2, 1, 2, 0, 4, 0, 0, 0, 1, 0, 0, 0,
|
||||
3, 1, 3, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
// builtin configuration handling functions
|
||||
|
||||
Bit32s usb_uhci_options_parser(const char *context, int num_params, char *params[])
|
||||
|
@ -3058,25 +3058,6 @@ void bx_usb_xhci_c::runtime_config(void)
|
||||
}
|
||||
}
|
||||
|
||||
// pci configuration space read callback handler
|
||||
Bit32u bx_usb_xhci_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
{
|
||||
Bit32u value = 0;
|
||||
|
||||
for (unsigned i=0; i<io_len; i++) {
|
||||
value |= (BX_XHCI_THIS pci_conf[address+i] << (i*8));
|
||||
}
|
||||
|
||||
if (io_len == 1)
|
||||
BX_DEBUG(("read PCI register 0x%02X value 0x%02X (len=1)", address, value));
|
||||
else if (io_len == 2)
|
||||
BX_DEBUG(("read PCI register 0x%02X value 0x%04X (len=2)", address, value));
|
||||
else if (io_len == 4)
|
||||
BX_DEBUG(("read PCI register 0x%02X value 0x%08X (len=4)", address, value));
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
// pci configuration space write callback handler
|
||||
void bx_usb_xhci_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2010-2016 Benjamin D Lunt (fys [at] fysnet [dot] net)
|
||||
// 2011-2016 The Bochs Project
|
||||
// 2011-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
|
||||
@ -540,8 +540,8 @@ public:
|
||||
virtual void reset(unsigned);
|
||||
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);
|
||||
|
||||
void event_handler(int event, USBPacket *packet, int port);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user