- io_len mask in i/o register functions implemented (1 = 8bit, 2 = 16bit, 4 = 32bit).

Unallowed cases are now handled in devices.cc and cause a BX_ERROR.
- io_len mask fixed and unnecessary io_len checks removed in
  * devices.cc
  * extfpuirq.cc
  * gameport.cc
  * ne2k.cc
  * pit.cc
  * pit_wrap.cc (i/o register function calls replaced by DEV_* macro calls)
- TODO: implement this in all other devices
This commit is contained in:
Volker Ruppert 2003-07-31 12:04:48 +00:00
parent 1d638d67b5
commit bcdcf42bdd
9 changed files with 98 additions and 107 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: devices.cc,v 1.54 2003-06-21 12:55:19 vruppert Exp $
// $Id: devices.cc,v 1.55 2003-07-31 12:04:48 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -94,7 +94,7 @@ bx_devices_c::init(BX_MEM_C *newmem)
{
unsigned i;
BX_DEBUG(("Init $Id: devices.cc,v 1.54 2003-06-21 12:55:19 vruppert Exp $"));
BX_DEBUG(("Init $Id: devices.cc,v 1.55 2003-07-31 12:04:48 vruppert Exp $"));
mem = newmem;
/* no read / write handlers defined */
@ -111,9 +111,11 @@ bx_devices_c::init(BX_MEM_C *newmem)
io_read_handler[BX_DEFAULT_IO_DEVICE].handler_name = "Default";
io_read_handler[BX_DEFAULT_IO_DEVICE].funct = &default_read_handler;
io_read_handler[BX_DEFAULT_IO_DEVICE].this_ptr = NULL;
io_read_handler[BX_DEFAULT_IO_DEVICE].mask = 7;
io_write_handler[BX_DEFAULT_IO_DEVICE].handler_name = "Default";
io_write_handler[BX_DEFAULT_IO_DEVICE].funct = &default_write_handler;
io_write_handler[BX_DEFAULT_IO_DEVICE].this_ptr = NULL;
io_write_handler[BX_DEFAULT_IO_DEVICE].mask = 7;
/* set handlers to the default one */
for (i=0; i < 0x10000; i++) {
@ -235,11 +237,11 @@ bx_devices_c::init(BX_MEM_C *newmem)
register_io_read_handler( this,
&read_handler,
0x0092,
"Port 92h System Control" );
"Port 92h System Control", 1 );
register_io_write_handler(this,
&write_handler,
0x0092,
"Port 92h System Control" );
"Port 92h System Control", 1 );
// misc. CMOS
Bit32u extended_memory_in_k = mem->get_memory_in_k() > 1024 ? (mem->get_memory_in_k() - 1024) : 0;
@ -334,9 +336,6 @@ bx_devices_c::port92_read(Bit32u address, unsigned io_len)
#else
UNUSED(this_ptr);
#endif // !BX_USE_DEV_SMF
if (io_len > 1)
BX_PANIC(("port 92h: io read from address %08x, len=%u",
(unsigned) address, (unsigned) io_len));
BX_DEBUG(("port92h read partially supported!!!"));
BX_DEBUG((" returning %02x", (unsigned) (BX_GET_ENABLE_A20() << 1)));
@ -361,10 +360,6 @@ bx_devices_c::port92_write(Bit32u address, Bit32u value, unsigned io_len)
#endif // !BX_USE_DEV_SMF
bx_bool bx_cpu_reset;
if (io_len > 1)
BX_PANIC(("port 92h: io read from address %08x, len=%u",
(unsigned) address, (unsigned) io_len));
BX_DEBUG(("port92h write of %02x partially supported!!!",
(unsigned) value));
BX_DEBUG(("A20: set_enable_a20() called"));
@ -475,7 +470,7 @@ bx_devices_c::unregister_irq(unsigned irq, const char *name)
bx_bool
bx_devices_c::register_io_read_handler( void *this_ptr, bx_read_handler_t f,
Bit32u addr, const char *name )
Bit32u addr, const char *name, Bit8u mask )
{
unsigned handle;
@ -496,6 +491,7 @@ bx_devices_c::register_io_read_handler( void *this_ptr, bx_read_handler_t f,
io_read_handler[handle].funct = f;
io_read_handler[handle].this_ptr = this_ptr;
io_read_handler[handle].handler_name = name;
io_read_handler[handle].mask = mask;
}
/* change table to reflect new handler id for that address */
@ -515,7 +511,7 @@ bx_devices_c::register_io_read_handler( void *this_ptr, bx_read_handler_t f,
bx_bool
bx_devices_c::register_io_write_handler( void *this_ptr, bx_write_handler_t f,
Bit32u addr, const char *name )
Bit32u addr, const char *name, Bit8u mask )
{
unsigned handle;
@ -536,6 +532,7 @@ bx_devices_c::register_io_write_handler( void *this_ptr, bx_write_handler_t f,
io_write_handler[handle].funct = f;
io_write_handler[handle].this_ptr = this_ptr;
io_write_handler[handle].handler_name = name;
io_write_handler[handle].mask = mask;
}
/* change table to reflect new handler id for that address */
@ -559,7 +556,7 @@ bx_devices_c::register_io_write_handler( void *this_ptr, bx_write_handler_t f,
bx_bool
bx_devices_c::register_default_io_read_handler( void *this_ptr, bx_read_handler_t f,
const char *name )
const char *name, Bit8u mask )
{
unsigned handle;
@ -574,6 +571,7 @@ bx_devices_c::register_default_io_read_handler( void *this_ptr, bx_read_handler_
io_read_handler[handle].funct = f;
io_read_handler[handle].this_ptr = this_ptr;
io_read_handler[handle].handler_name = name;
io_read_handler[handle].mask = mask;
return true;
}
@ -582,7 +580,7 @@ bx_devices_c::register_default_io_read_handler( void *this_ptr, bx_read_handler_
bx_bool
bx_devices_c::register_default_io_write_handler( void *this_ptr, bx_write_handler_t f,
const char *name )
const char *name, Bit8u mask )
{
unsigned handle;
@ -597,6 +595,7 @@ bx_devices_c::register_default_io_write_handler( void *this_ptr, bx_write_handle
io_write_handler[handle].funct = f;
io_write_handler[handle].this_ptr = this_ptr;
io_write_handler[handle].handler_name = name;
io_write_handler[handle].mask = mask;
return true;
}
@ -616,9 +615,18 @@ bx_devices_c::inp(Bit16u addr, unsigned io_len)
BX_INSTR_INP(addr, io_len);
handle = read_handler_id[addr];
// FIXME, we want to make sure that there is a default handler there
ret = (* io_read_handler[handle].funct)(io_read_handler[handle].this_ptr,
(Bit32u) addr, io_len);
if ((io_read_handler[handle].funct != NULL) &&
(io_read_handler[handle].mask & io_len)) {
ret = (* io_read_handler[handle].funct)(io_read_handler[handle].this_ptr,
(Bit32u) addr, io_len);
} else {
switch (io_len) {
case 1: ret = 0xff; break;
case 2: ret = 0xffff; break;
default: ret = 0xffffffff; break;
}
BX_ERROR(("read from port 0x%04x with len %d returns 0x%x", addr, io_len, ret));
}
BX_INSTR_INP2(addr, io_len, ret);
BX_DBG_IO_REPORT(addr, io_len, BX_READ, ret);
return(ret);
@ -639,9 +647,13 @@ bx_devices_c::outp(Bit16u addr, Bit32u value, unsigned io_len)
BX_DBG_IO_REPORT(addr, io_len, BX_WRITE, value);
handle = write_handler_id[addr];
// FIXME, we want to make sure that there is a default handler there
(* io_write_handler[handle].funct)(io_write_handler[handle].this_ptr,
(Bit32u) addr, value, io_len);
if ((io_write_handler[handle].funct != NULL) &&
(io_write_handler[handle].mask & io_len)) {
(* io_write_handler[handle].funct)(io_write_handler[handle].this_ptr,
(Bit32u) addr, value, io_len);
} else {
BX_ERROR(("write to port 0x%04x with len %d ignored", addr, io_len));
}
}
bx_bool bx_devices_c::is_serial_enabled ()

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: extfpuirq.cc,v 1.4 2003-06-21 09:52:32 vruppert Exp $
// $Id: extfpuirq.cc,v 1.5 2003-07-31 12:04:48 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -70,7 +70,7 @@ bx_extfpuirq_c::~bx_extfpuirq_c(void)
bx_extfpuirq_c::init(void)
{
// called once when bochs initializes
DEV_register_iowrite_handler(this, write_handler, 0x00F0, "External FPU IRQ", 7);
DEV_register_iowrite_handler(this, write_handler, 0x00F0, "External FPU IRQ", 1);
DEV_register_irq(13, "External FPU IRQ");
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: gameport.cc,v 1.1 2003-06-21 12:55:19 vruppert Exp $
// $Id: gameport.cc,v 1.2 2003-07-31 12:04:48 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2003 MandrakeSoft S.A.
@ -81,8 +81,8 @@ bx_gameport_c::init(void)
{
// Allocate the gameport IO address range 0x200..0x207
for (unsigned addr=0x200; addr<0x208; addr++) {
DEV_register_ioread_handler(this, read_handler, addr, "Gameport", 7);
DEV_register_iowrite_handler(this, write_handler, addr, "Gameport", 7);
DEV_register_ioread_handler(this, read_handler, addr, "Gameport", 1);
DEV_register_iowrite_handler(this, write_handler, addr, "Gameport", 1);
}
BX_GAMEPORT_THIS port = 0xf0;
@ -161,10 +161,6 @@ bx_gameport_c::read(Bit32u address, unsigned io_len)
#endif // !BX_USE_GAME_SMF
Bit64u usec;
if (io_len > 1)
BX_PANIC(("io read from port %04x, len=%u", (unsigned) address,
(unsigned) io_len));
if (BX_GAMEPORT_THIS joyfd >= 0) {
poll_joydev();
usec = bx_pc_system.time_usec();
@ -205,9 +201,6 @@ bx_gameport_c::write(Bit32u address, Bit32u value, unsigned io_len)
#else
UNUSED(this_ptr);
#endif // !BX_USE_GAME_SMF
if (io_len > 1)
BX_PANIC(("io write to port %04x, len=%u", (unsigned) address,
(unsigned) io_len));
BX_GAMEPORT_THIS write_usec = bx_pc_system.time_usec();
BX_GAMEPORT_THIS timer_x = 1;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: iodev.h,v 1.34 2003-07-13 19:51:20 vruppert Exp $
// $Id: iodev.h,v 1.35 2003-07-31 12:04:48 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -277,10 +277,10 @@ public:
// power-on, hardware, or software.
void reset(unsigned type);
BX_MEM_C *mem; // address space associated with these devices
bx_bool register_io_read_handler(void *this_ptr, bx_read_handler_t f, Bit32u addr, const char *name );
bx_bool register_io_write_handler(void *this_ptr, bx_write_handler_t f, Bit32u addr, const char *name );
bx_bool register_default_io_read_handler(void *this_ptr, bx_read_handler_t f, const char *name );
bx_bool register_default_io_write_handler(void *this_ptr, bx_write_handler_t f, const char *name );
bx_bool register_io_read_handler(void *this_ptr, bx_read_handler_t f, Bit32u addr, const char *name, Bit8u mask );
bx_bool register_io_write_handler(void *this_ptr, bx_write_handler_t f, Bit32u addr, const char *name, Bit8u mask );
bx_bool register_default_io_read_handler(void *this_ptr, bx_read_handler_t f, const char *name, Bit8u mask );
bx_bool register_default_io_write_handler(void *this_ptr, bx_write_handler_t f, const char *name, Bit8u mask );
bx_bool register_irq(unsigned irq, const char *name);
bx_bool unregister_irq(unsigned irq, const char *name);
void iodev_init(void);
@ -345,6 +345,7 @@ private:
bx_read_handler_t funct;
void *this_ptr;
const char *handler_name; // name of device
Bit8u mask; // io_len mask
} io_read_handler[BX_MAX_IO_DEVICES];
unsigned num_read_handles;
@ -353,6 +354,7 @@ private:
bx_write_handler_t funct;
void *this_ptr;
const char *handler_name; // name of device
Bit8u mask; // io_len mask
} io_write_handler[BX_MAX_IO_DEVICES];
unsigned num_write_handles;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: ne2k.cc,v 1.53 2003-07-30 10:45:13 vruppert Exp $
// $Id: ne2k.cc,v 1.54 2003-07-31 12:04:48 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -1272,7 +1272,7 @@ bx_ne2k_c::rx_frame(const void *buf, unsigned io_len)
void
bx_ne2k_c::init(void)
{
BX_DEBUG(("Init $Id: ne2k.cc,v 1.53 2003-07-30 10:45:13 vruppert Exp $"));
BX_DEBUG(("Init $Id: ne2k.cc,v 1.54 2003-07-31 12:04:48 vruppert Exp $"));
// Read in values from config file
BX_NE2K_THIS s.base_address = bx_options.ne2k.Oioaddr->get ();
@ -1290,8 +1290,8 @@ bx_ne2k_c::init(void)
for (unsigned addr = BX_NE2K_THIS s.base_address;
addr <= BX_NE2K_THIS s.base_address + 0x20;
addr++) {
DEV_register_ioread_handler(this, read_handler, addr, "ne2000 NIC", 1);
DEV_register_iowrite_handler(this, write_handler, addr, "ne2000 NIC", 1);
DEV_register_ioread_handler(this, read_handler, addr, "ne2000 NIC", 3);
DEV_register_iowrite_handler(this, write_handler, addr, "ne2000 NIC", 3);
}
BX_INFO(("port 0x%x/32 irq %d mac %02x:%02x:%02x:%02x:%02x:%02x",
BX_NE2K_THIS s.base_address,

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: pit.cc,v 1.14 2002-10-26 03:57:19 bdenney Exp $
// $Id: pit.cc,v 1.15 2003-07-31 12:04:48 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -161,17 +161,17 @@ bx_pit_c::~bx_pit_c( void )
bx_pit_c::init( void )
{
DEV_register_irq(0, "8254 PIT");
DEV_register_ioread_handler(this, read_handler, 0x0040, "8254 PIT", 7);
DEV_register_ioread_handler(this, read_handler, 0x0041, "8254 PIT", 7);
DEV_register_ioread_handler(this, read_handler, 0x0042, "8254 PIT", 7);
DEV_register_ioread_handler(this, read_handler, 0x0043, "8254 PIT", 7);
DEV_register_ioread_handler(this, read_handler, 0x0061, "8254 PIT", 7);
DEV_register_ioread_handler(this, read_handler, 0x0040, "8254 PIT", 1);
DEV_register_ioread_handler(this, read_handler, 0x0041, "8254 PIT", 1);
DEV_register_ioread_handler(this, read_handler, 0x0042, "8254 PIT", 1);
DEV_register_ioread_handler(this, read_handler, 0x0043, "8254 PIT", 1);
DEV_register_ioread_handler(this, read_handler, 0x0061, "8254 PIT", 1);
DEV_register_iowrite_handler(this, write_handler, 0x0040, "8254 PIT", 7);
DEV_register_iowrite_handler(this, write_handler, 0x0041, "8254 PIT", 7);
DEV_register_iowrite_handler(this, write_handler, 0x0042, "8254 PIT", 7);
DEV_register_iowrite_handler(this, write_handler, 0x0043, "8254 PIT", 7);
DEV_register_iowrite_handler(this, write_handler, 0x0061, "8254 PIT", 7);
DEV_register_iowrite_handler(this, write_handler, 0x0040, "8254 PIT", 1);
DEV_register_iowrite_handler(this, write_handler, 0x0041, "8254 PIT", 1);
DEV_register_iowrite_handler(this, write_handler, 0x0042, "8254 PIT", 1);
DEV_register_iowrite_handler(this, write_handler, 0x0043, "8254 PIT", 1);
DEV_register_iowrite_handler(this, write_handler, 0x0061, "8254 PIT", 1);
BX_PIT_THIS s.speaker_data_on = 0;
BX_PIT_THIS s.refresh_clock_div2 = 0;
@ -243,10 +243,6 @@ bx_pit_c::read( Bit32u address, unsigned int io_len )
#else
UNUSED(this_ptr);
#endif // !BX_USE_PIT_SMF
if (io_len > 1)
BX_PANIC(("pit: io read from port %04x, len=%u", (unsigned) address,
(unsigned) io_len));
if (bx_dbg.pit)
BX_INFO(("pit: io read from port %04x", (unsigned) address));
@ -299,10 +295,6 @@ bx_pit_c::write( Bit32u address, Bit32u dvalue,
value = (Bit8u ) dvalue;
if (io_len > 1)
BX_PANIC(("pit: io write to port %04x, len=%u", (unsigned) address,
(unsigned) io_len));
if (bx_dbg.pit)
BX_INFO(("pit: write to port %04x = %02x",
(unsigned) address, (unsigned) value));

View File

@ -1,5 +1,5 @@
////////////////////////////////////////////////////////////////////////
// $Id: pit_wrap.cc,v 1.50 2003-06-07 19:16:54 vruppert Exp $
// $Id: pit_wrap.cc,v 1.51 2003-07-31 12:04:48 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -180,18 +180,18 @@ bx_pit_c::~bx_pit_c( void )
int
bx_pit_c::init( void )
{
bx_devices.register_irq(0, "8254 PIT");
bx_devices.register_io_read_handler(this, read_handler, 0x0040, "8254 PIT");
bx_devices.register_io_read_handler(this, read_handler, 0x0041, "8254 PIT");
bx_devices.register_io_read_handler(this, read_handler, 0x0042, "8254 PIT");
bx_devices.register_io_read_handler(this, read_handler, 0x0043, "8254 PIT");
bx_devices.register_io_read_handler(this, read_handler, 0x0061, "8254 PIT");
DEV_register_irq(0, "8254 PIT");
DEV_register_ioread_handler(this, read_handler, 0x0040, "8254 PIT", 1);
DEV_register_ioread_handler(this, read_handler, 0x0041, "8254 PIT", 1);
DEV_register_ioread_handler(this, read_handler, 0x0042, "8254 PIT", 1);
DEV_register_ioread_handler(this, read_handler, 0x0043, "8254 PIT", 1);
DEV_register_ioread_handler(this, read_handler, 0x0061, "8254 PIT", 1);
bx_devices.register_io_write_handler(this, write_handler, 0x0040, "8254 PIT");
bx_devices.register_io_write_handler(this, write_handler, 0x0041, "8254 PIT");
bx_devices.register_io_write_handler(this, write_handler, 0x0042, "8254 PIT");
bx_devices.register_io_write_handler(this, write_handler, 0x0043, "8254 PIT");
bx_devices.register_io_write_handler(this, write_handler, 0x0061, "8254 PIT");
DEV_register_iowrite_handler(this, write_handler, 0x0040, "8254 PIT", 1);
DEV_register_iowrite_handler(this, write_handler, 0x0041, "8254 PIT", 1);
DEV_register_iowrite_handler(this, write_handler, 0x0042, "8254 PIT", 1);
DEV_register_iowrite_handler(this, write_handler, 0x0043, "8254 PIT", 1);
DEV_register_iowrite_handler(this, write_handler, 0x0061, "8254 PIT", 1);
BX_DEBUG(("pit: starting init"));
@ -320,10 +320,6 @@ bx_pit_c::read( Bit32u address, unsigned int io_len )
Bit64u my_time_usec = bx_virt_timer.time_usec();
if (io_len > 1)
BX_PANIC(("pit: io read from port %04x, len=%u", (unsigned) address,
(unsigned) io_len));
if (bx_dbg.pit)
BX_INFO(("pit: io read from port %04x", (unsigned) address));
@ -391,10 +387,6 @@ bx_pit_c::write( Bit32u address, Bit32u dvalue,
value = (Bit8u ) dvalue;
if (io_len > 1)
BX_PANIC(("pit: io write to port %04x, len=%u", (unsigned) address,
(unsigned) io_len));
if (bx_dbg.pit)
BX_INFO(("pit: write to port %04x = %02x",
(unsigned) address, (unsigned) value));

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: plugin.cc,v 1.7 2003-07-10 20:26:05 vruppert Exp $
// $Id: plugin.cc,v 1.8 2003-07-31 12:04:47 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// This file defines the plugin and plugin-device registration functions and
@ -38,13 +38,13 @@ void (*pluginSetHRQ)(unsigned val) = 0;
void (*pluginSetHRQHackCallback)( void (*callback)(void) ) = 0;
int (*pluginRegisterIOReadHandler)(void *thisPtr, ioReadHandler_t callback,
unsigned base, const char *name, unsigned len) = 0;
unsigned base, const char *name, Bit8u mask) = 0;
int (*pluginRegisterIOWriteHandler)(void *thisPtr, ioWriteHandler_t callback,
unsigned base, const char *name, unsigned len) = 0;
unsigned base, const char *name, Bit8u mask) = 0;
int (*pluginRegisterDefaultIOReadHandler)(void *thisPtr, ioReadHandler_t callback,
const char *name, unsigned len) = 0;
const char *name, Bit8u mask) = 0;
int (*pluginRegisterDefaultIOWriteHandler)(void *thisPtr, ioWriteHandler_t callback,
const char *name, unsigned len) = 0;
const char *name, Bit8u mask) = 0;
int (*pluginRegisterTimer)(void *this_ptr, void (*funct)(void *),
Bit32u useconds, bx_bool continuous,
bx_bool active, const char* name) = 0;
@ -114,40 +114,40 @@ builtinResetSignal( unsigned )
static int
builtinRegisterIOReadHandler(void *thisPtr, ioReadHandler_t callback,
unsigned base, const char *name, unsigned len)
unsigned base, const char *name, Bit8u mask)
{
BX_ASSERT (len<8);
bx_devices.register_io_read_handler (thisPtr, callback, base, name);
BX_ASSERT (mask<8);
bx_devices.register_io_read_handler (thisPtr, callback, base, name, mask);
pluginlog->ldebug("plugin %s registered I/O read address at %04x", name, base);
return 0;
}
static int
builtinRegisterIOWriteHandler(void *thisPtr, ioWriteHandler_t callback,
unsigned base, const char *name, unsigned len)
unsigned base, const char *name, Bit8u mask)
{
BX_ASSERT (len<8);
bx_devices.register_io_write_handler (thisPtr, callback, base, name);
BX_ASSERT (mask<8);
bx_devices.register_io_write_handler (thisPtr, callback, base, name, mask);
pluginlog->ldebug("plugin %s registered I/O write address at %04x", name, base);
return 0;
}
static int
builtinRegisterDefaultIOReadHandler(void *thisPtr, ioReadHandler_t callback,
const char *name, unsigned len)
const char *name, Bit8u mask)
{
BX_ASSERT (len<8);
bx_devices.register_default_io_read_handler (thisPtr, callback, name);
BX_ASSERT (mask<8);
bx_devices.register_default_io_read_handler (thisPtr, callback, name, mask);
pluginlog->ldebug("plugin %s registered default I/O read ", name);
return 0;
}
static int
builtinRegisterDefaultIOWriteHandler(void *thisPtr, ioWriteHandler_t callback,
const char *name, unsigned len)
const char *name, Bit8u mask)
{
BX_ASSERT (len<8);
bx_devices.register_default_io_write_handler (thisPtr, callback, name);
BX_ASSERT (mask<8);
bx_devices.register_default_io_write_handler (thisPtr, callback, name, mask);
pluginlog->ldebug("plugin %s registered default I/O write ", name);
return 0;
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: plugin.h,v 1.18 2003-07-13 19:51:20 vruppert Exp $
// $Id: plugin.h,v 1.19 2003-07-31 12:04:47 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// This file provides macros and types needed for plugins. It is based on
@ -65,10 +65,10 @@ extern "C" {
// When plugins are off, PLUG_load_plugin will call the plugin_init function
// directly.
#define PLUG_load_plugin(name,type) {lib##name##_LTX_plugin_init(NULL,type,0,NULL);}
#define DEV_register_ioread_handler(b,c,d,e,f) bx_devices.register_io_read_handler(b,c,d,e)
#define DEV_register_iowrite_handler(b,c,d,e,f) bx_devices.register_io_write_handler(b,c,d,e)
#define DEV_register_default_ioread_handler(b,c,d,e) bx_devices.register_default_io_read_handler(b,c,d)
#define DEV_register_default_iowrite_handler(b,c,d,e) bx_devices.register_default_io_write_handler(b,c,d)
#define DEV_register_ioread_handler(b,c,d,e,f) bx_devices.register_io_read_handler(b,c,d,e,f)
#define DEV_register_iowrite_handler(b,c,d,e,f) bx_devices.register_io_write_handler(b,c,d,e,f)
#define DEV_register_default_ioread_handler(b,c,d,e) bx_devices.register_default_io_read_handler(b,c,d,e)
#define DEV_register_default_iowrite_handler(b,c,d,e) bx_devices.register_default_io_write_handler(b,c,d,e)
#define DEV_register_irq(b,c) bx_devices.register_irq(b,c)
#define DEV_unregister_irq(b,c) bx_devices.unregister_irq(b,c)
@ -212,13 +212,13 @@ BOCHSAPI bx_bool pluginDevicePresent(char *name);
/* === IO port stuff === */
BOCHSAPI extern int (*pluginRegisterIOReadHandler)(void *thisPtr, ioReadHandler_t callback,
unsigned base, const char *name, unsigned len);
unsigned base, const char *name, Bit8u mask);
BOCHSAPI extern int (*pluginRegisterIOWriteHandler)(void *thisPtr, ioWriteHandler_t callback,
unsigned base, const char *name, unsigned len);
unsigned base, const char *name, Bit8u mask);
BOCHSAPI extern int (*pluginRegisterDefaultIOReadHandler)(void *thisPtr, ioReadHandler_t callback,
const char *name, unsigned len);
const char *name, Bit8u mask);
BOCHSAPI extern int (*pluginRegisterDefaultIOWriteHandler)(void *thisPtr, ioWriteHandler_t callback,
const char *name, unsigned len);
const char *name, Bit8u mask);
/* === A20 enable line stuff === */
BOCHSAPI extern unsigned (*pluginGetA20E)(void);