Fixed compilation error
[bochs-mirror.git] / iodev / parallel.h
blob0e99d5a7d6acb3f55bfa49a3027023582636462c
1 /////////////////////////////////////////////////////////////////////////
2 // $Id: parallel.h,v 1.16 2007/09/28 19:52:03 sshwarts Exp $
3 /////////////////////////////////////////////////////////////////////////
4 //
5 // Copyright (C) 2001 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
27 #ifndef BX_IODEV_PARPORT_H
28 #define BX_IODEV_PARPORT_H
30 #if BX_USE_PAR_SMF
31 # define BX_PAR_SMF static
32 # define BX_PAR_THIS theParallelDevice->
33 #else
34 # define BX_PAR_SMF
35 # define BX_PAR_THIS this->
36 #endif
38 #define BX_PARPORT_MAXDEV 2
40 #define BX_PAR_DATA 0
41 #define BX_PAR_STAT 1
42 #define BX_PAR_CTRL 2
44 typedef struct {
45 Bit8u data;
46 struct {
47 bx_bool error;
48 bx_bool slct;
49 bx_bool pe;
50 bx_bool ack;
51 bx_bool busy;
52 } STATUS;
53 struct {
54 bx_bool strobe;
55 bx_bool autofeed;
56 bx_bool init;
57 bx_bool slct_in;
58 bx_bool irq;
59 bx_bool input;
60 } CONTROL;
61 Bit8u IRQ;
62 FILE *output;
63 bx_bool initmode;
64 } bx_par_t;
66 class bx_parallel_c : public bx_devmodel_c {
67 public:
68 bx_parallel_c();
69 virtual ~bx_parallel_c();
70 virtual void init(void);
71 virtual void reset(unsigned type);
72 virtual void register_state(void);
74 private:
75 bx_par_t s[BX_PARPORT_MAXDEV];
77 static void virtual_printer(Bit8u port);
79 static Bit32u read_handler(void *this_ptr, Bit32u address, unsigned io_len);
80 static void write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len);
81 #if !BX_USE_PAR_SMF
82 Bit32u read(Bit32u address, unsigned io_len);
83 void write(Bit32u address, Bit32u value, unsigned io_len);
84 #endif
87 #endif