1 /////////////////////////////////////////////////////////////////////////
2 // $Id: extfpuirq.cc,v 1.10 2008/07/26 08:02:27 vruppert Exp $
3 /////////////////////////////////////////////////////////////////////////
5 // Copyright (C) 2002 MandrakeSoft S.A.
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 // External circuit for MSDOS compatible FPU exceptions
31 // Define BX_PLUGGABLE in files that can be compiled into plugins. For
32 // platforms that require a special tag on exported symbols, BX_PLUGGABLE
33 // is used to know when we are exporting symbols and when we are importing.
38 #define LOG_THIS theExternalFpuIrq->
40 bx_extfpuirq_c
*theExternalFpuIrq
= NULL
;
42 int libextfpuirq_LTX_plugin_init(plugin_t
*plugin
, plugintype_t type
, int argc
, char *argv
[])
44 theExternalFpuIrq
= new bx_extfpuirq_c();
45 BX_REGISTER_DEVICE_DEVMODEL(plugin
, type
, theExternalFpuIrq
, BX_PLUGIN_EXTFPUIRQ
);
49 void libextfpuirq_LTX_plugin_fini(void)
51 delete theExternalFpuIrq
;
54 bx_extfpuirq_c::bx_extfpuirq_c(void)
57 settype(EXTFPUIRQLOG
);
60 bx_extfpuirq_c::~bx_extfpuirq_c(void)
65 void bx_extfpuirq_c::init(void)
67 // called once when bochs initializes
68 DEV_register_iowrite_handler(this, write_handler
, 0x00F0, "External FPU IRQ", 1);
69 DEV_register_irq(13, "External FPU IRQ");
72 void bx_extfpuirq_c::reset(unsigned type
)
74 // We should handle IGNNE here
75 DEV_pic_lower_irq(13);
78 // static IO port write callback handler
79 // redirects to non-static class handler to avoid virtual functions
81 void bx_extfpuirq_c::write_handler(void *this_ptr
, Bit32u address
, Bit32u value
, unsigned io_len
)
84 bx_extfpuirq_c
*class_ptr
= (bx_extfpuirq_c
*) this_ptr
;
85 class_ptr
->write(address
, value
, io_len
);
88 void bx_extfpuirq_c::write(Bit32u address
, Bit32u value
, unsigned io_len
)
92 #endif // !BX_USE_EFI_SMF
94 // We should handle IGNNE here
95 DEV_pic_lower_irq(13);