2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2011-02-25 01:05:47 +03:00
|
|
|
// $Id$
|
2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2021-01-31 02:55:24 +03:00
|
|
|
// Copyright (C) 2002-2021 The Bochs Project
|
2001-04-10 05:04:59 +04:00
|
|
|
//
|
|
|
|
// 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
|
2009-02-08 12:05:52 +03:00
|
|
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2006-03-07 21:16:41 +03:00
|
|
|
#ifndef BX_IODEV_PCI_BRIDGE_H
|
|
|
|
#define BX_IODEV_PCI_BRIDGE_H
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
#if BX_USE_PCI_SMF
|
|
|
|
# define BX_PCI_SMF static
|
2002-11-09 23:51:40 +03:00
|
|
|
# define BX_PCI_THIS thePciBridge->
|
2001-04-10 05:04:59 +04:00
|
|
|
#else
|
|
|
|
# define BX_PCI_SMF
|
|
|
|
# define BX_PCI_THIS this->
|
|
|
|
#endif
|
|
|
|
|
2012-11-08 23:12:26 +04:00
|
|
|
#define BX_PCI_DEVICE(device, function) ((device)<<3 | (function))
|
|
|
|
|
2004-07-04 21:10:05 +04:00
|
|
|
#define BX_PCI_INTA 1
|
|
|
|
#define BX_PCI_INTB 2
|
|
|
|
#define BX_PCI_INTC 3
|
|
|
|
#define BX_PCI_INTD 4
|
2004-07-02 02:18:20 +04:00
|
|
|
|
2018-02-24 21:04:36 +03:00
|
|
|
class bx_pci_vbridge_c;
|
|
|
|
|
2017-03-26 11:09:28 +03:00
|
|
|
class bx_pci_bridge_c : public bx_pci_device_c {
|
2001-04-10 05:04:59 +04:00
|
|
|
public:
|
2006-03-07 21:16:41 +03:00
|
|
|
bx_pci_bridge_c();
|
2006-03-08 00:11:20 +03:00
|
|
|
virtual ~bx_pci_bridge_c();
|
2006-03-03 23:15:07 +03:00
|
|
|
virtual void init(void);
|
|
|
|
virtual void reset(unsigned type);
|
2006-05-27 19:54:49 +04:00
|
|
|
virtual void register_state(void);
|
|
|
|
virtual void after_restore_state(void);
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2021-01-31 02:55:24 +03:00
|
|
|
static bool agp_ap_read_handler(bx_phy_address addr, unsigned len, void *data, void *param);
|
|
|
|
static bool agp_ap_write_handler(bx_phy_address addr, unsigned len, void *data, void *param);
|
2018-03-04 07:53:16 +03:00
|
|
|
|
2021-01-31 13:50:53 +03:00
|
|
|
Bit32u agp_aperture_read(bx_phy_address addr, unsigned len, bool agp);
|
|
|
|
void agp_aperture_write(bx_phy_address addr, Bit32u value, unsigned len, bool agp);
|
2018-03-04 07:53:16 +03:00
|
|
|
|
2017-03-24 22:57:25 +03:00
|
|
|
virtual void pci_write_handler(Bit8u address, Bit32u value, unsigned io_len);
|
2012-03-10 21:14:07 +04:00
|
|
|
#if BX_DEBUGGER
|
2012-04-23 21:06:19 +04:00
|
|
|
virtual void debug_dump(int argc, char **argv);
|
2012-03-10 21:14:07 +04:00
|
|
|
#endif
|
2009-04-22 00:27:35 +04:00
|
|
|
|
2001-04-10 05:04:59 +04:00
|
|
|
private:
|
2006-03-27 02:15:07 +04:00
|
|
|
void smram_control(Bit8u value);
|
2012-11-11 12:11:17 +04:00
|
|
|
|
|
|
|
unsigned chipset;
|
2013-01-25 19:52:39 +04:00
|
|
|
Bit8u DRBA[8];
|
|
|
|
Bit8u dram_detect;
|
2018-03-04 07:53:16 +03:00
|
|
|
Bit32u gart_base;
|
2018-02-24 21:04:36 +03:00
|
|
|
bx_pci_vbridge_c *vbridge;
|
|
|
|
};
|
|
|
|
|
|
|
|
class bx_pci_vbridge_c : public bx_pci_device_c {
|
|
|
|
public:
|
|
|
|
bx_pci_vbridge_c();
|
|
|
|
virtual ~bx_pci_vbridge_c();
|
|
|
|
virtual void init(void);
|
|
|
|
virtual void reset(unsigned type);
|
|
|
|
virtual void register_state(void);
|
|
|
|
virtual void after_restore_state(void);
|
|
|
|
|
|
|
|
virtual void pci_write_handler(Bit8u address, Bit32u value, unsigned io_len);
|
2006-03-03 23:15:07 +03:00
|
|
|
};
|
2006-03-07 21:16:41 +03:00
|
|
|
#endif
|