removed not implemented g2h device

This commit is contained in:
Stanislav Shwartsman 2011-07-10 21:25:12 +00:00
parent 20ae4af54c
commit a6853a8b75
6 changed files with 1 additions and 230 deletions

View File

@ -94,6 +94,7 @@ Bochs repository moved to the SVN version control !
[3190995] add eth backend based on Slirp by Heikki Lindholm
- these S.F. bugs were closed/fixed
[1819639] Two incompatible crc32 modules
[3324111] configure for VCPP.NET issues
[3190970] Installing linux causes a crash in pci_ide
[3077616] Fedora 13 installation fails on Bochs 2.4.5

View File

@ -336,11 +336,6 @@ gameport.o: gameport.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
../instrument/stubs/instrument.h ../param_names.h gameport.h
guest2host.o: guest2host.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
../instrument/stubs/instrument.h ../param_names.h guest2host.h
harddrv.o: harddrv.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
@ -679,11 +674,6 @@ gameport.lo: gameport.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
../instrument/stubs/instrument.h ../param_names.h gameport.h
guest2host.lo: guest2host.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
../instrument/stubs/instrument.h ../param_names.h guest2host.h
harddrv.lo: harddrv.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \

View File

@ -96,9 +96,6 @@ void bx_devices_c::init_stubs()
#if BX_SUPPORT_SOUNDLOW
pluginSoundModCtl = &stubSoundModCtl;
#endif
#if 0
g2h = NULL;
#endif
}
void bx_devices_c::init(BX_MEM_C *newmem)
@ -340,13 +337,6 @@ void bx_devices_c::init(BX_MEM_C *newmem)
/*--- 82C54 PIT ---*/
pluginPitDevice->init();
#if 0
// Guest to Host interface. Used with special guest drivers
// which move data to/from the host environment.
g2h = &bx_g2h;
g2h->init();
#endif
// system hardware
register_io_read_handler(this, &read_handler, 0x0092,
"Port 92h System Control", 1);

View File

@ -1,135 +0,0 @@
/////////////////////////////////////////////////////////////////////////
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2009 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
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
/////////////////////////////////////////////////////////////////////////
#include "iodev.h"
#include "guest2host.h"
#define LOG_THIS bx_g2h.
bx_g2h_c bx_g2h;
bx_g2h_c::bx_g2h_c()
{
put("G2H");
unsigned i;
for (i=0; i<BX_MAX_G2H_CHANNELS; i++) {
s.callback[i].f = NULL;
s.callback[i].used = 0;
}
}
bx_g2h_c::~bx_g2h_c()
{
// nothing for now
}
void bx_g2h_c::init(void)
{
BX_DEBUG(("Init $Id$"));
// Reserve a dword port for this interface
for (Bit32u addr=BX_G2H_PORT; addr<=(BX_G2H_PORT+3); addr++) {
bx_devices.register_io_read_handler(&bx_g2h,
inp_handler, addr, "g2h");
bx_devices.register_io_write_handler(&bx_g2h,
outp_handler, addr, "g2h");
}
memset(&bx_g2h.s, 0, sizeof(bx_g2h.s));
}
void bx_g2h_c::reset(unsigned type)
{
}
unsigned bx_g2h_c::acquire_channel(bx_g2h_callback_t f)
{
unsigned i;
for (i=0; i<BX_MAX_G2H_CHANNELS; i++) {
if (bx_g2h.s.callback[i].used==0) {
bx_g2h.s.callback[i].f = f;
bx_g2h.s.callback[i].used = 1;
return(i);
}
}
BX_INFO(("g2h: attempt to acquire channel: maxed out"));
return BX_G2H_ERROR; // No more free channels
}
unsigned bx_g2h_c::deacquire_channel(unsigned channel)
{
if ((channel >= BX_MAX_G2H_CHANNELS) ||
(bx_g2h.s.callback[channel].used==0))
{
BX_PANIC(("g2h: attempt to deacquire channel %u: not acquired", channel));
}
bx_g2h.s.callback[channel].used = 0;
bx_g2h.s.callback[channel].f = NULL;
return 0;
}
// static IO port read callback handler
// redirects to non-static class handler to avoid virtual functions
Bit32u bx_g2h_c::inp_handler(void *this_ptr, Bit32u addr, unsigned io_len)
{
UNUSED(this_ptr);
if (addr != BX_G2H_PORT)
BX_PANIC(("g2h: IO read not aligned on dword boundary."));
if (io_len != 4)
BX_PANIC(("g2h: IO read not dword."));
BX_PANIC(("g2h: IO read not complete."));
return(0);
}
void bx_g2h_c::outp_handler(void *this_ptr, Bit32u addr, Bit32u val32, unsigned io_len)
{
UNUSED(this_ptr);
if (addr != BX_G2H_PORT)
BX_PANIC(("g2h: IO write not aligned on dword boundary."));
if (io_len != 4)
BX_PANIC(("g2h: IO write not dword."));
if ((bx_g2h.s.packet_count==0) && (val32!=BX_G2H_MAGIC)) {
BX_INFO(("g2h: IO W: Not magic header."));
return;
}
bx_g2h.s.guest_packet[bx_g2h.s.packet_count++] = val32;
if (bx_g2h.s.packet_count >= BX_G2H_PACKET_SIZE) {
unsigned channel;
// Full packet received from guest. Pass on to the host code.
channel = bx_g2h.s.guest_packet[1];
if (channel >= BX_MAX_G2H_CHANNELS) {
BX_PANIC(("g2h: channel (%u) out of bounds", channel));
}
if (bx_g2h.s.callback[channel].used==0) {
BX_PANIC(("g2h: channel (%u) not active", channel));
}
bx_g2h.s.callback[channel].f(&bx_g2h.s.guest_packet);
bx_g2h.s.packet_count = 0; // Ready for next packet
}
}

View File

@ -1,68 +0,0 @@
/////////////////////////////////////////////////////////////////////////
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2009 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
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
#define BX_MAX_G2H_CHANNELS 8
#define BX_G2H_ERROR ((unsigned) -1)
// IO port number for this interface. Align on dword boundary.
#define BX_G2H_PORT 0x2000
// Magic number which is first dword passed by guest
#define BX_G2H_MAGIC 0xffeeddcc
// Number of dwords in packet from guest
#define BX_G2H_PACKET_SIZE 5
typedef Bit32u bx_guest_packet_t[BX_G2H_PACKET_SIZE];
typedef void (*bx_g2h_callback_t)(bx_guest_packet_t *);
class bx_g2h_c : public logfunctions {
public:
bx_g2h_c();
virtual ~bx_g2h_c();
static void init(void);
void reset(unsigned type);
unsigned acquire_channel(bx_g2h_callback_t);
unsigned deacquire_channel(unsigned channel);
private:
static Bit32u inp_handler(void *this_ptr, Bit32u addr, unsigned io_len);
static void outp_handler(void *this_ptr, Bit32u addr,
Bit32u value, unsigned io_len);
// state info
struct {
struct {
bx_g2h_callback_t f;
bx_bool used;
} callback[BX_MAX_G2H_CHANNELS];
// Define the data received from the guest OS.
// dword0: magic number, should be BX_G2H_MAGIC
// dword1: channel ID
// dword2: address of data structure in guest physical memory
// dword3: size of data structure in guest physical memory
// dword4: address of return data structure in guest physical memory
unsigned packet_count;
bx_guest_packet_t guest_packet;
} s;
};
extern bx_g2h_c bx_g2h;

View File

@ -36,10 +36,6 @@
/* size of internal buffer for mouse devices */
#define BX_MOUSE_BUFF_SIZE 48
#if 0
class bx_g2h_c;
#endif
typedef Bit32u (*bx_read_handler_t)(void *, Bit32u, unsigned);
typedef void (*bx_write_handler_t)(void *, Bit32u, Bit32u, unsigned);
@ -474,9 +470,6 @@ public:
#if BX_SUPPORT_SOUNDLOW
bx_soundmod_ctl_stub_c *pluginSoundModCtl;
#endif
#if 0
bx_g2h_c *g2h;
#endif
// stub classes that the pointers (above) can point to until a plugin is
// loaded