- converted devices pci and pci2isa to plugins
- moved PCI presence check to devices.cc - moved initialization of the PCI register arrays from constructor to init() - PCI macros updated
This commit is contained in:
parent
6c6519a73d
commit
01027b46c9
@ -69,7 +69,6 @@ OBJS_THAT_CANNOT_BE_PLUGINS = \
|
||||
devices.o \
|
||||
pit.o pit82c54.o pit_wrap.o \
|
||||
@IODEBUG_OBJS@ \
|
||||
@PCI_OBJ@ \
|
||||
@NE2K_OBJS@ \
|
||||
@SB16_OBJS@ \
|
||||
@SLOWDOWN_OBJS@ \
|
||||
@ -87,7 +86,8 @@ OBJS_THAT_CAN_BE_PLUGINS = \
|
||||
cmos.o \
|
||||
harddrv.o \
|
||||
dma.o \
|
||||
unmapped.o
|
||||
unmapped.o \
|
||||
@PCI_OBJ@
|
||||
|
||||
OBJS_THAT_SUPPORT_OTHER_PLUGINS = \
|
||||
scancodes.o \
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: devices.cc,v 1.40 2002-10-26 13:14:03 bdenney Exp $
|
||||
// $Id: devices.cc,v 1.41 2002-11-09 20:51:40 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -49,8 +49,8 @@ bx_devices_c::bx_devices_c(void)
|
||||
settype(DEVLOG);
|
||||
|
||||
#if BX_PCI_SUPPORT
|
||||
pci = NULL;
|
||||
pci2isa = NULL;
|
||||
pluginPciBridge = &stubPci;
|
||||
pluginPci2IsaBridge = NULL;
|
||||
#endif
|
||||
pit = NULL;
|
||||
pluginKeyboard = &stubKeyboard;
|
||||
@ -86,7 +86,7 @@ bx_devices_c::init(BX_MEM_C *newmem)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
BX_DEBUG(("Init $Id: devices.cc,v 1.40 2002-10-26 13:14:03 bdenney Exp $"));
|
||||
BX_DEBUG(("Init $Id: devices.cc,v 1.41 2002-11-09 20:51:40 vruppert Exp $"));
|
||||
mem = newmem;
|
||||
|
||||
/* no read / write handlers defined */
|
||||
@ -143,10 +143,12 @@ bx_devices_c::init(BX_MEM_C *newmem)
|
||||
|
||||
#if BX_PCI_SUPPORT
|
||||
// PCI logic (i440FX)
|
||||
pci = & bx_pci;
|
||||
pci->init();
|
||||
pci2isa = & bx_pci2isa;
|
||||
pci2isa->init();
|
||||
if (bx_options.Oi440FXSupport->get ()) {
|
||||
PLUG_load_plugin(pci, PLUGTYPE_OPTIONAL);
|
||||
PLUG_load_plugin(pci2isa, PLUGTYPE_OPTIONAL);
|
||||
pluginPciBridge->init();
|
||||
pluginPci2IsaBridge->init();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if BX_SUPPORT_APIC
|
||||
@ -251,8 +253,10 @@ bx_devices_c::reset(unsigned type)
|
||||
{
|
||||
pluginUnmapped->reset(type);
|
||||
#if BX_PCI_SUPPORT
|
||||
pci->reset(type);
|
||||
pci2isa->reset(type);
|
||||
if (bx_options.Oi440FXSupport->get ()) {
|
||||
pluginPciBridge->reset(type);
|
||||
pluginPci2IsaBridge->reset(type);
|
||||
}
|
||||
#endif
|
||||
#if BX_SUPPORT_IOAPIC
|
||||
ioapic->reset (type);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: iodev.h,v 1.21 2002-10-26 13:14:04 bdenney Exp $
|
||||
// $Id: iodev.h,v 1.22 2002-11-09 20:51:40 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -44,8 +44,6 @@
|
||||
class bx_pit_c;
|
||||
class bx_keyb_c;
|
||||
class bx_sb16_c;
|
||||
class bx_pci_c;
|
||||
class bx_pci2isa_c;
|
||||
class bx_ioapic_c;
|
||||
class bx_ne2k_c;
|
||||
class bx_g2h_c;
|
||||
@ -245,6 +243,23 @@ class BOCHSAPI bx_vga_stub_c : public bx_devmodel_c {
|
||||
}
|
||||
};
|
||||
|
||||
class BOCHSAPI bx_pci_stub_c : public bx_devmodel_c {
|
||||
public:
|
||||
virtual bx_bool register_pci_handlers(void *this_ptr,
|
||||
Bit32u (*bx_pci_read_handler)(void *, Bit8u, unsigned),
|
||||
void(*bx_pci_write_handler)(void *, Bit8u, Bit32u, unsigned),
|
||||
Bit8u devfunc, const char *name) {
|
||||
STUBFUNC(pci, register_pci_handlers); return 0;
|
||||
}
|
||||
virtual Bit8u rd_memType (Bit32u addr) {
|
||||
return 0;
|
||||
}
|
||||
virtual Bit8u wr_memType (Bit32u addr) {
|
||||
return 0;
|
||||
}
|
||||
virtual void print_i440fx_state(void) {}
|
||||
};
|
||||
|
||||
class BOCHSAPI bx_devices_c : public logfunctions {
|
||||
public:
|
||||
bx_devices_c(void);
|
||||
@ -273,8 +288,8 @@ public:
|
||||
|
||||
bx_devmodel_c *pluginBiosDevice;
|
||||
bx_ioapic_c *ioapic;
|
||||
bx_pci_c *pci;
|
||||
bx_pci2isa_c *pci2isa;
|
||||
bx_pci_stub_c *pluginPciBridge;
|
||||
bx_devmodel_c *pluginPci2IsaBridge;
|
||||
bx_pit_c *pit;
|
||||
bx_keyb_stub_c *pluginKeyboard;
|
||||
bx_dma_stub_c *pluginDmaDevice;
|
||||
@ -302,6 +317,7 @@ public:
|
||||
bx_pic_stub_c stubPic;
|
||||
bx_floppy_stub_c stubFloppy;
|
||||
bx_vga_stub_c stubVga;
|
||||
bx_pci_stub_c stubPci;
|
||||
|
||||
// Some info to pass to devices which can handled bulk IO. This allows
|
||||
// the interface to remain the same for IO devices which can't handle
|
||||
@ -350,8 +366,10 @@ private:
|
||||
|
||||
|
||||
|
||||
#if BX_PCI_SUPPORT
|
||||
#include "iodev/pci.h"
|
||||
#include "iodev/pci2isa.h"
|
||||
#endif
|
||||
#include "iodev/vga.h"
|
||||
#if BX_SUPPORT_APIC
|
||||
# include "iodev/ioapic.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: pci.cc,v 1.23 2002-11-03 17:17:10 vruppert Exp $
|
||||
// $Id: pci.cc,v 1.24 2002-11-09 20:51:40 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -24,43 +24,38 @@
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
//
|
||||
// i440FX Support - PMC/DBX
|
||||
//
|
||||
|
||||
|
||||
// Define BX_PLUGGABLE in files that can be compiled into plugins. For
|
||||
// platforms that require a special tag on exported symbols, BX_PLUGGABLE
|
||||
// is used to know when we are exporting symbols and when we are importing.
|
||||
#define BX_PLUGGABLE
|
||||
|
||||
#include "bochs.h"
|
||||
#define LOG_THIS bx_pci.
|
||||
#define LOG_THIS thePciBridge->
|
||||
|
||||
bx_pci_c *thePciBridge = NULL;
|
||||
|
||||
int
|
||||
libpci_LTX_plugin_init(plugin_t *plugin, plugintype_t type, int argc, char *argv[])
|
||||
{
|
||||
thePciBridge = new bx_pci_c ();
|
||||
bx_devices.pluginPciBridge = thePciBridge;
|
||||
BX_REGISTER_DEVICE_DEVMODEL(plugin, type, thePciBridge, BX_PLUGIN_PCI);
|
||||
return(0); // Success
|
||||
}
|
||||
|
||||
//
|
||||
// i440FX Support
|
||||
//
|
||||
|
||||
|
||||
bx_pci_c bx_pci;
|
||||
#if BX_USE_PCI_SMF
|
||||
#define this (&bx_pci)
|
||||
#endif
|
||||
|
||||
void
|
||||
libpci_LTX_plugin_fini(void)
|
||||
{
|
||||
}
|
||||
|
||||
bx_pci_c::bx_pci_c(void)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
put("PCI");
|
||||
settype(PCILOG);
|
||||
|
||||
BX_PCI_THIS num_pci_handles = 0;
|
||||
|
||||
/* set unused elements to appropriate values */
|
||||
for (i=0; i < BX_MAX_PCI_DEVICES; i++) {
|
||||
BX_PCI_THIS pci_handler[i].read = NULL;
|
||||
BX_PCI_THIS pci_handler[i].write = NULL;
|
||||
}
|
||||
|
||||
for (i=0; i < 0x100; i++) {
|
||||
BX_PCI_THIS pci_handler_id[i] = BX_MAX_PCI_DEVICES; // not assigned
|
||||
}
|
||||
}
|
||||
|
||||
bx_pci_c::~bx_pci_c(void)
|
||||
@ -75,29 +70,39 @@ bx_pci_c::init(void)
|
||||
{
|
||||
// called once when bochs initializes
|
||||
|
||||
if (bx_options.Oi440FXSupport->get ()) {
|
||||
DEV_register_ioread_handler(this, read_handler, 0x0CF8, "i440FX", 4);
|
||||
for (unsigned i=0x0CFC; i<=0x0CFF; i++) {
|
||||
DEV_register_ioread_handler(this, read_handler, i, "i440FX", 7);
|
||||
}
|
||||
BX_PCI_THIS num_pci_handles = 0;
|
||||
|
||||
DEV_register_iowrite_handler(this, write_handler, 0x0CF8, "i440FX", 4);
|
||||
for (unsigned i=0x0CFC; i<=0x0CFF; i++) {
|
||||
DEV_register_iowrite_handler(this, write_handler, i, "i440FX", 7);
|
||||
}
|
||||
/* set unused elements to appropriate values */
|
||||
for (unsigned i=0; i < BX_MAX_PCI_DEVICES; i++) {
|
||||
BX_PCI_THIS pci_handler[i].read = NULL;
|
||||
BX_PCI_THIS pci_handler[i].write = NULL;
|
||||
}
|
||||
|
||||
DEV_register_pci_handlers(this, pci_read_handler, pci_write_handler,
|
||||
0x00, "440FX Host bridge");
|
||||
|
||||
for (unsigned i=0; i<256; i++)
|
||||
BX_PCI_THIS s.i440fx.pci_conf[i] = 0x0;
|
||||
// readonly registers
|
||||
BX_PCI_THIS s.i440fx.pci_conf[0x00] = 0x86;
|
||||
BX_PCI_THIS s.i440fx.pci_conf[0x01] = 0x80;
|
||||
BX_PCI_THIS s.i440fx.pci_conf[0x02] = 0x37;
|
||||
BX_PCI_THIS s.i440fx.pci_conf[0x03] = 0x12;
|
||||
BX_PCI_THIS s.i440fx.pci_conf[0x0b] = 0x06;
|
||||
for (unsigned i=0; i < 0x100; i++) {
|
||||
BX_PCI_THIS pci_handler_id[i] = BX_MAX_PCI_DEVICES; // not assigned
|
||||
}
|
||||
|
||||
DEV_register_ioread_handler(this, read_handler, 0x0CF8, "i440FX", 4);
|
||||
for (unsigned i=0x0CFC; i<=0x0CFF; i++) {
|
||||
DEV_register_ioread_handler(this, read_handler, i, "i440FX", 7);
|
||||
}
|
||||
|
||||
DEV_register_iowrite_handler(this, write_handler, 0x0CF8, "i440FX", 4);
|
||||
for (unsigned i=0x0CFC; i<=0x0CFF; i++) {
|
||||
DEV_register_iowrite_handler(this, write_handler, i, "i440FX", 7);
|
||||
}
|
||||
|
||||
DEV_register_pci_handlers(this, pci_read_handler, pci_write_handler,
|
||||
0x00, "440FX Host bridge");
|
||||
|
||||
for (unsigned i=0; i<256; i++)
|
||||
BX_PCI_THIS s.i440fx.pci_conf[i] = 0x0;
|
||||
// readonly registers
|
||||
BX_PCI_THIS s.i440fx.pci_conf[0x00] = 0x86;
|
||||
BX_PCI_THIS s.i440fx.pci_conf[0x01] = 0x80;
|
||||
BX_PCI_THIS s.i440fx.pci_conf[0x02] = 0x37;
|
||||
BX_PCI_THIS s.i440fx.pci_conf[0x03] = 0x12;
|
||||
BX_PCI_THIS s.i440fx.pci_conf[0x0b] = 0x06;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: pci.h,v 1.12 2002-10-25 11:44:40 bdenney Exp $
|
||||
// $Id: pci.h,v 1.13 2002-11-09 20:51:40 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -25,8 +25,6 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
#if BX_PCI_SUPPORT
|
||||
|
||||
#define BX_MAX_PCI_DEVICES 20
|
||||
|
||||
typedef Bit32u (*bx_pci_read_handler_t)(void *, Bit8u, unsigned);
|
||||
@ -34,7 +32,7 @@ typedef void (*bx_pci_write_handler_t)(void *, Bit8u, Bit32u, unsigned);
|
||||
|
||||
#if BX_USE_PCI_SMF
|
||||
# define BX_PCI_SMF static
|
||||
# define BX_PCI_THIS bx_pci.
|
||||
# define BX_PCI_THIS thePciBridge->
|
||||
#else
|
||||
# define BX_PCI_SMF
|
||||
# define BX_PCI_THIS this->
|
||||
@ -49,19 +47,20 @@ typedef struct {
|
||||
|
||||
|
||||
|
||||
class bx_pci_c : public logfunctions {
|
||||
class bx_pci_c : public bx_pci_stub_c {
|
||||
|
||||
public:
|
||||
bx_pci_c(void);
|
||||
~bx_pci_c(void);
|
||||
BX_PCI_SMF void init(void);
|
||||
BX_PCI_SMF void reset(unsigned type);
|
||||
bx_bool register_pci_handlers(void *this_ptr, bx_pci_read_handler_t f1,
|
||||
bx_pci_write_handler_t f2, Bit8u devfunc,
|
||||
const char *name);
|
||||
BX_PCI_SMF void print_i440fx_state( );
|
||||
BX_PCI_SMF Bit8u rd_memType (Bit32u addr);
|
||||
BX_PCI_SMF Bit8u wr_memType (Bit32u addr);
|
||||
virtual void init(void);
|
||||
virtual void reset(unsigned type);
|
||||
virtual bx_bool register_pci_handlers(void *this_ptr,
|
||||
bx_pci_read_handler_t f1,
|
||||
bx_pci_write_handler_t f2,
|
||||
Bit8u devfunc, const char *name);
|
||||
virtual void print_i440fx_state(void);
|
||||
virtual Bit8u rd_memType (Bit32u addr);
|
||||
virtual Bit8u wr_memType (Bit32u addr);
|
||||
|
||||
private:
|
||||
Bit8u pci_handler_id[0x100]; // 256 devices/functions
|
||||
@ -87,9 +86,3 @@ private:
|
||||
void pci_write(Bit8u address, Bit32u value, unsigned io_len);
|
||||
#endif
|
||||
};
|
||||
|
||||
#if BX_USE_PCI_SMF
|
||||
extern bx_pci_c bx_pci;
|
||||
#endif
|
||||
|
||||
#endif // #if BX_PCI_SUPPORT
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: pci2isa.cc,v 1.4 2002-11-03 17:17:10 vruppert Exp $
|
||||
// $Id: pci2isa.cc,v 1.5 2002-11-09 20:51:40 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -24,24 +24,33 @@
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
|
||||
|
||||
#include "bochs.h"
|
||||
#define LOG_THIS bx_pci2isa.
|
||||
|
||||
|
||||
|
||||
//
|
||||
// i440FX Support - PCI-to-ISA bridge (PIIX3)
|
||||
//
|
||||
|
||||
// Define BX_PLUGGABLE in files that can be compiled into plugins. For
|
||||
// platforms that require a special tag on exported symbols, BX_PLUGGABLE
|
||||
// is used to know when we are exporting symbols and when we are importing.
|
||||
#define BX_PLUGGABLE
|
||||
|
||||
bx_pci2isa_c bx_pci2isa;
|
||||
#if BX_USE_P2I_SMF
|
||||
#define this (&bx_pci2isa)
|
||||
#endif
|
||||
#include "bochs.h"
|
||||
#define LOG_THIS thePci2IsaBridge->
|
||||
|
||||
bx_pci2isa_c *thePci2IsaBridge = NULL;
|
||||
|
||||
int
|
||||
libpci2isa_LTX_plugin_init(plugin_t *plugin, plugintype_t type, int argc, char *argv[])
|
||||
{
|
||||
thePci2IsaBridge = new bx_pci2isa_c ();
|
||||
bx_devices.pluginPci2IsaBridge = thePci2IsaBridge;
|
||||
BX_REGISTER_DEVICE_DEVMODEL(plugin, type, thePci2IsaBridge, BX_PLUGIN_PCI2ISA);
|
||||
return(0); // Success
|
||||
}
|
||||
|
||||
void
|
||||
libpci2isa_LTX_plugin_fini(void)
|
||||
{
|
||||
}
|
||||
|
||||
bx_pci2isa_c::bx_pci2isa_c(void)
|
||||
{
|
||||
@ -61,34 +70,32 @@ bx_pci2isa_c::init(void)
|
||||
{
|
||||
// called once when bochs initializes
|
||||
|
||||
if (bx_options.Oi440FXSupport->get ()) {
|
||||
DEV_register_pci_handlers(this, pci_read_handler, pci_write_handler,
|
||||
0x08, "PIIX3 PCI-to-ISA bridge");
|
||||
DEV_register_pci_handlers(this, pci_read_handler, pci_write_handler,
|
||||
0x08, "PIIX3 PCI-to-ISA bridge");
|
||||
|
||||
DEV_register_iowrite_handler(this, write_handler, 0x00B2, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_iowrite_handler(this, write_handler, 0x00B3, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_iowrite_handler(this, write_handler, 0x00F0, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_iowrite_handler(this, write_handler, 0x04D0, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_iowrite_handler(this, write_handler, 0x04D1, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_iowrite_handler(this, write_handler, 0x0CF9, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_iowrite_handler(this, write_handler, 0x00B2, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_iowrite_handler(this, write_handler, 0x00B3, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_iowrite_handler(this, write_handler, 0x00F0, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_iowrite_handler(this, write_handler, 0x04D0, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_iowrite_handler(this, write_handler, 0x04D1, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_iowrite_handler(this, write_handler, 0x0CF9, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
|
||||
DEV_register_ioread_handler(this, read_handler, 0x00B2, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_ioread_handler(this, read_handler, 0x00B3, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_ioread_handler(this, read_handler, 0x04D0, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_ioread_handler(this, read_handler, 0x04D1, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_ioread_handler(this, read_handler, 0x0CF9, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_ioread_handler(this, read_handler, 0x00B2, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_ioread_handler(this, read_handler, 0x00B3, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_ioread_handler(this, read_handler, 0x04D0, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_ioread_handler(this, read_handler, 0x04D1, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
DEV_register_ioread_handler(this, read_handler, 0x0CF9, "PIIX3 PCI-to-ISA bridge", 7);
|
||||
|
||||
for (unsigned i=0; i<256; i++)
|
||||
BX_P2I_THIS s.pci_conf[i] = 0x0;
|
||||
// readonly registers
|
||||
BX_P2I_THIS s.pci_conf[0x00] = 0x86;
|
||||
BX_P2I_THIS s.pci_conf[0x01] = 0x80;
|
||||
BX_P2I_THIS s.pci_conf[0x02] = 0x00;
|
||||
BX_P2I_THIS s.pci_conf[0x03] = 0x70;
|
||||
BX_P2I_THIS s.pci_conf[0x0a] = 0x01;
|
||||
BX_P2I_THIS s.pci_conf[0x0b] = 0x06;
|
||||
BX_P2I_THIS s.pci_conf[0x0e] = 0x80;
|
||||
}
|
||||
for (unsigned i=0; i<256; i++)
|
||||
BX_P2I_THIS s.pci_conf[i] = 0x0;
|
||||
// readonly registers
|
||||
BX_P2I_THIS s.pci_conf[0x00] = 0x86;
|
||||
BX_P2I_THIS s.pci_conf[0x01] = 0x80;
|
||||
BX_P2I_THIS s.pci_conf[0x02] = 0x00;
|
||||
BX_P2I_THIS s.pci_conf[0x03] = 0x70;
|
||||
BX_P2I_THIS s.pci_conf[0x0a] = 0x01;
|
||||
BX_P2I_THIS s.pci_conf[0x0b] = 0x06;
|
||||
BX_P2I_THIS s.pci_conf[0x0e] = 0x80;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: pci2isa.h,v 1.3 2002-10-24 21:07:45 bdenney Exp $
|
||||
// $Id: pci2isa.h,v 1.4 2002-11-09 20:51:40 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -25,24 +25,22 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
#if BX_PCI_SUPPORT
|
||||
|
||||
#if BX_USE_P2I_SMF
|
||||
# define BX_P2I_SMF static
|
||||
# define BX_P2I_THIS bx_pci2isa.
|
||||
# define BX_P2I_THIS thePci2IsaBridge->
|
||||
#else
|
||||
# define BX_P2I_SMF
|
||||
# define BX_P2I_THIS this->
|
||||
#endif
|
||||
|
||||
|
||||
class bx_pci2isa_c : public logfunctions {
|
||||
class bx_pci2isa_c : public bx_devmodel_c {
|
||||
|
||||
public:
|
||||
bx_pci2isa_c(void);
|
||||
~bx_pci2isa_c(void);
|
||||
BX_PCI_SMF void init(void);
|
||||
BX_PCI_SMF void reset(unsigned type);
|
||||
virtual void init(void);
|
||||
virtual void reset(unsigned type);
|
||||
|
||||
private:
|
||||
|
||||
@ -63,9 +61,3 @@ private:
|
||||
void pci_write(Bit8u address, Bit32u value, unsigned io_len);
|
||||
#endif
|
||||
};
|
||||
|
||||
#if BX_USE_P2I_SMF
|
||||
extern bx_pci2isa_c bx_pci2isa;
|
||||
#endif
|
||||
|
||||
#endif // #if BX_PCI_SUPPORT
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: main.cc,v 1.175 2002-11-09 14:12:09 cbothamy Exp $
|
||||
// $Id: main.cc,v 1.176 2002-11-09 20:51:39 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -1976,7 +1976,7 @@ bx_atexit(void)
|
||||
|
||||
#if BX_PCI_SUPPORT
|
||||
if (bx_options.Oi440FXSupport->get ()) {
|
||||
bx_devices.pci->print_i440fx_state();
|
||||
bx_devices.pluginPciBridge->print_i440fx_state();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: plugin.h,v 1.4 2002-11-03 17:17:09 vruppert Exp $
|
||||
// $Id: plugin.h,v 1.5 2002-11-09 20:51:40 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// This file provides macros and types needed for plugins. It is based on
|
||||
@ -32,6 +32,8 @@ extern "C" {
|
||||
#define BX_PLUGIN_HARDDRV "harddrv"
|
||||
#define BX_PLUGIN_DMA "dma"
|
||||
#define BX_PLUGIN_PIC "pic"
|
||||
#define BX_PLUGIN_PCI "pci"
|
||||
#define BX_PLUGIN_PCI2ISA "pci2isa"
|
||||
|
||||
#define BX_REGISTER_DEVICE pluginRegisterDevice
|
||||
#define BX_REGISTER_DEVICE_DEVMODEL(a,b,c,d) pluginRegisterDeviceDevmodel(a,b,c,d)
|
||||
@ -149,9 +151,9 @@ extern "C" {
|
||||
|
||||
///////// PCI macros
|
||||
#define DEV_register_pci_handlers(b,c,d,e,f) \
|
||||
(bx_pci.register_pci_handlers(b,c,d,e,f))
|
||||
#define DEV_pci_rd_memtype(addr) bx_pci.rd_memType(addr)
|
||||
#define DEV_pci_wr_memtype(addr) bx_pci.wr_memType(addr)
|
||||
(bx_devices.pluginPciBridge->register_pci_handlers(b,c,d,e,f))
|
||||
#define DEV_pci_rd_memtype(addr) bx_devices.pluginPciBridge->rd_memType(addr)
|
||||
#define DEV_pci_wr_memtype(addr) bx_devices.pluginPciBridge->wr_memType(addr)
|
||||
|
||||
|
||||
#if BX_HAVE_DLFCN_H
|
||||
@ -248,6 +250,14 @@ BOCHSAPI extern void (*pluginSetHRQHackCallback)( void (*callback)(void) );
|
||||
/* === Reset stuff === */
|
||||
BOCHSAPI extern void (*pluginResetSignal)(unsigned sig);
|
||||
|
||||
/* === PCI stuff === */
|
||||
BOCHSAPI extern bx_bool (*pluginRegisterPCIDevice)(void *this_ptr,
|
||||
Bit32u (*bx_pci_read_handler)(void *, Bit8u, unsigned),
|
||||
void(*bx_pci_write_handler)(void *, Bit8u, Bit32u, unsigned),
|
||||
Bit8u devfunc, const char *name);
|
||||
BOCHSAPI extern Bit8u (*pluginRd_memType)(Bit32u addr);
|
||||
BOCHSAPI extern Bit8u (*pluginWr_memType)(Bit32u addr);
|
||||
|
||||
void plugin_abort (void);
|
||||
|
||||
// called from bochs main (hack)
|
||||
@ -277,6 +287,8 @@ DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(pic)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(vga)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(floppy)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(parallel)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(pci)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(pci2isa)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(amigaos)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(beos)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(carbon)
|
||||
|
Loading…
x
Reference in New Issue
Block a user