- added instructions how to update the online documentation
[bochs-mirror.git] / iodev / pci2isa.h
blobcb01d5d5f1a4dc325e12ba24db994ed0e637ebf7
1 /////////////////////////////////////////////////////////////////////////
2 // $Id: pci2isa.h,v 1.15 2007/09/28 19:52:03 sshwarts Exp $
3 /////////////////////////////////////////////////////////////////////////
4 //
5 // Copyright (C) 2002 MandrakeSoft S.A.
6 //
7 // MandrakeSoft S.A.
8 // 43, rue d'Aboukir
9 // 75002 Paris - France
10 // http://www.linux-mandrake.com/
11 // http://www.mandrakesoft.com/
13 // This library is free software; you can redistribute it and/or
14 // modify it under the terms of the GNU Lesser General Public
15 // License as published by the Free Software Foundation; either
16 // version 2 of the License, or (at your option) any later version.
18 // This library is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 // Lesser General Public License for more details.
23 // You should have received a copy of the GNU Lesser General Public
24 // License along with this library; if not, write to the Free Software
25 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef BX_IODEV_PIC2ISA_H
29 #define BX_IODEV_PIC2ISA_H
31 #if BX_USE_P2I_SMF
32 # define BX_P2I_SMF static
33 # define BX_P2I_THIS thePci2IsaBridge->
34 #else
35 # define BX_P2I_SMF
36 # define BX_P2I_THIS this->
37 #endif
40 class bx_piix3_c : public bx_pci2isa_stub_c {
41 public:
42 bx_piix3_c();
43 virtual ~bx_piix3_c();
44 virtual void init(void);
45 virtual void reset(unsigned type);
46 virtual void pci_set_irq(Bit8u devfunc, unsigned line, bx_bool level);
47 virtual void register_state(void);
48 virtual void after_restore_state(void);
50 virtual Bit32u pci_read_handler(Bit8u address, unsigned io_len);
51 virtual void pci_write_handler(Bit8u address, Bit32u value, unsigned io_len);
53 private:
55 struct {
56 Bit8u pci_conf[256];
57 Bit8u elcr1;
58 Bit8u elcr2;
59 Bit8u apmc;
60 Bit8u apms;
61 Bit8u irq_registry[16];
62 Bit32u irq_level[16];
63 Bit8u pci_reset;
64 } s;
66 static void pci_register_irq(unsigned pirq, unsigned irq);
67 static void pci_unregister_irq(unsigned pirq);
69 static Bit32u read_handler(void *this_ptr, Bit32u address, unsigned io_len);
70 static void write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len);
71 #if !BX_USE_P2I_SMF
72 Bit32u read(Bit32u address, unsigned io_len);
73 void write(Bit32u address, Bit32u value, unsigned io_len);
74 #endif
77 #endif