Fixed number of compilation errors for FPU disabled case

Transfer fpu.cc from /fpu to /cpu
This commit is contained in:
Stanislav Shwartsman 2003-04-22 20:21:34 +00:00
parent 87c91a9d72
commit d1d2fb34f0
8 changed files with 50 additions and 64 deletions

View File

@ -62,6 +62,7 @@ OBJS = \
ctrl_xfer32.o \
ctrl_xfer16.o \
mmx.o \
fpu.o \
sse.o \
sse_move.o \
sse_pfp.o \
@ -511,6 +512,17 @@ logical8.o: logical8.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h \
../iodev/pit82c54.h ../iodev/serial.h ../iodev/unmapped.h \
../iodev/eth.h ../iodev/ne2k.h ../iodev/guest2host.h \
../iodev/slowdown_timer.h ../instrument/stubs/instrument.h
fpu.o: fpu.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../debug/debug.h \
../bxversion.h ../gui/siminterface.h ../state_file.h ../cpu/cpu.h \
../cpu/lazy_flags.h ../cpu/i387.h ../memory/memory.h ../pc_system.h \
../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h ../gui/textconfig.h \
../gui/keymap.h ../iodev/iodev.h ../iodev/vga.h ../iodev/biosdev.h \
../iodev/cmos.h ../iodev/dma.h ../iodev/floppy.h ../iodev/harddrv.h \
../iodev/cdrom.h ../iodev/keyboard.h ../iodev/parallel.h \
../iodev/pic.h ../iodev/pit.h ../iodev/pit_wrap.h ../iodev/pit82c54.h \
../iodev/serial.h ../iodev/unmapped.h ../iodev/eth.h ../iodev/ne2k.h \
../iodev/guest2host.h ../iodev/slowdown_timer.h \
../instrument/stubs/instrument.h
mmx.o: mmx.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../debug/debug.h \
../bxversion.h ../gui/siminterface.h ../state_file.h ../cpu/cpu.h \
../cpu/lazy_flags.h ../cpu/i387.h ../memory/memory.h ../pc_system.h \

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.136 2003-04-06 19:08:22 sshwarts Exp $
// $Id: cpu.h,v 1.137 2003-04-22 20:21:31 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -1285,7 +1285,9 @@ typedef void (*BxDTShim_t)(void);
class BX_MEM_C;
#if BX_SUPPORT_FPU
#include "cpu/i387.h"
#endif
#if BX_SUPPORT_SSE
#include "cpu/xmm.h"
@ -1425,7 +1427,9 @@ union {
bx_regs_msr_t msr;
#endif
#if BX_SUPPORT_FPU
i387_t the_i387;
#endif
#if BX_SUPPORT_SSE
bx_xmm_reg_t xmm[BX_XMM_REGISTERS];
@ -2256,9 +2260,11 @@ union {
BX_SMF void PSLLDQ_WdqIb(bxInstruction_c *i);
/* SSE2 */
#if BX_SUPPORT_FPU
BX_SMF void fpu_execute(bxInstruction_c *i);
BX_SMF void fpu_init(void);
BX_SMF void fpu_print_regs (void);
#endif
BX_SMF void CMPXCHG_XBTS(bxInstruction_c *);
BX_SMF void CMPXCHG_IBTS(bxInstruction_c *);

View File

@ -1,3 +1,6 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu.cc,v 1.1 2003-04-22 20:21:32 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
// Copyright (C) 2001 MandrakeSoft S.A.
//
// MandrakeSoft S.A.
@ -38,8 +41,7 @@
void
BX_CPU_C::ESC0(bxInstruction_c *i)
void BX_CPU_C::ESC0(bxInstruction_c *i)
{
if ( BX_CPU_THIS_PTR cr0.em || BX_CPU_THIS_PTR cr0.ts ) {
exception(BX_NM_EXCEPTION, 0, 0);
@ -47,12 +49,11 @@ BX_CPU_C::ESC0(bxInstruction_c *i)
#if BX_SUPPORT_FPU
fpu_execute(i);
#else
BX_INFO(("ESC0 not implemented"));
BX_INFO(("FPU: ESC0 not implemented, use --enable-fpu"));
#endif
}
void
BX_CPU_C::ESC1(bxInstruction_c *i)
void BX_CPU_C::ESC1(bxInstruction_c *i)
{
if ( BX_CPU_THIS_PTR cr0.em || BX_CPU_THIS_PTR cr0.ts ) {
exception(BX_NM_EXCEPTION, 0, 0);
@ -60,12 +61,11 @@ BX_CPU_C::ESC1(bxInstruction_c *i)
#if BX_SUPPORT_FPU
fpu_execute(i);
#else
BX_INFO(("ESC1 not implemented"));
BX_INFO(("FPU: ESC1 not implemented, use --enable-fpu"));
#endif
}
void
BX_CPU_C::ESC2(bxInstruction_c *i)
void BX_CPU_C::ESC2(bxInstruction_c *i)
{
if ( BX_CPU_THIS_PTR cr0.em || BX_CPU_THIS_PTR cr0.ts ) {
exception(BX_NM_EXCEPTION, 0, 0);
@ -73,29 +73,24 @@ BX_CPU_C::ESC2(bxInstruction_c *i)
#if BX_SUPPORT_FPU
fpu_execute(i);
#else
BX_INFO(("ESC2 not implemented"));
BX_INFO(("FPU: ESC2 not implemented, use --enable-fpu"));
#endif
}
void
BX_CPU_C::ESC3(bxInstruction_c *i)
void BX_CPU_C::ESC3(bxInstruction_c *i)
{
if ( BX_CPU_THIS_PTR cr0.em || BX_CPU_THIS_PTR cr0.ts ) {
exception(BX_NM_EXCEPTION, 0, 0);
}
//BX_DEBUG(( "CS:EIP = %04x:%08x",
// BX_CPU.sregs[BX_SEG_REG_CS].selector.value, BX_CPU.prev_eip));
#if BX_SUPPORT_FPU
fpu_execute(i);
#else
BX_INFO(("ESC3 not implemented"));
BX_INFO(("FPU: ESC3 not implemented, use --enable-fpu"));
#endif
}
void
BX_CPU_C::ESC4(bxInstruction_c *i)
void BX_CPU_C::ESC4(bxInstruction_c *i)
{
if ( BX_CPU_THIS_PTR cr0.em || BX_CPU_THIS_PTR cr0.ts ) {
exception(BX_NM_EXCEPTION, 0, 0);
@ -103,12 +98,11 @@ BX_CPU_C::ESC4(bxInstruction_c *i)
#if BX_SUPPORT_FPU
fpu_execute(i);
#else
BX_INFO(("ESC4 not implemented"));
BX_INFO(("FPU: ESC4 not implemented, use --enable-fpu"));
#endif
}
void
BX_CPU_C::ESC5(bxInstruction_c *i)
void BX_CPU_C::ESC5(bxInstruction_c *i)
{
if ( BX_CPU_THIS_PTR cr0.em || BX_CPU_THIS_PTR cr0.ts ) {
exception(BX_NM_EXCEPTION, 0, 0);
@ -116,12 +110,11 @@ BX_CPU_C::ESC5(bxInstruction_c *i)
#if BX_SUPPORT_FPU
fpu_execute(i);
#else
BX_INFO(("ESC5 not implemented"));
BX_INFO(("FPU: ESC5 not implemented, use --enable-fpu"));
#endif
}
void
BX_CPU_C::ESC6(bxInstruction_c *i)
void BX_CPU_C::ESC6(bxInstruction_c *i)
{
if ( BX_CPU_THIS_PTR cr0.em || BX_CPU_THIS_PTR cr0.ts ) {
exception(BX_NM_EXCEPTION, 0, 0);
@ -129,12 +122,11 @@ BX_CPU_C::ESC6(bxInstruction_c *i)
#if BX_SUPPORT_FPU
fpu_execute(i);
#else
BX_INFO(("ESC6 not implemented"));
BX_INFO(("FPU: ESC6 not implemented, use --enable-fpu"));
#endif
}
void
BX_CPU_C::ESC7(bxInstruction_c *i)
void BX_CPU_C::ESC7(bxInstruction_c *i)
{
if ( BX_CPU_THIS_PTR cr0.em || BX_CPU_THIS_PTR cr0.ts ) {
exception(BX_NM_EXCEPTION, 0, 0);
@ -142,38 +134,27 @@ BX_CPU_C::ESC7(bxInstruction_c *i)
#if BX_SUPPORT_FPU
fpu_execute(i);
#else
BX_INFO(("ESC7 not implemented"));
BX_INFO(("FPU: ESC7 not implemented, use --enable-fpu"));
#endif
}
void
BX_CPU_C::FWAIT(bxInstruction_c *i)
void BX_CPU_C::FWAIT(bxInstruction_c *i)
{
#if BX_CPU_LEVEL < 3
// WAIT doesn't generate single steps on 8086.
// The same goes for prefix instructions, and instructions which
// modify segment registers. (pg4-16)
// single_step_event = 0;
BX_PANIC(("WAIT: not implemented for < 386"));
#else // BX_CPU_LEVEL >= 3
if ( BX_CPU_THIS_PTR cr0.ts && BX_CPU_THIS_PTR cr0.mp ) {
exception(BX_NM_EXCEPTION, 0, 0); // no error
exception(BX_NM_EXCEPTION, 0, 0);
}
#if BX_SUPPORT_FPU
fpu_execute(i);
#else
BX_INFO(("FWAIT: no FPU"));
BX_INFO(("FWAIT: requred FPU, use --enable-fpu"));
#endif
#endif
}
#if BX_SUPPORT_FPU==0
// if supporting FPU, this function in glue logic file
void
BX_CPU_C::fpu_init(void)
{
}
#endif

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: init.cc,v 1.46 2003-02-13 15:51:22 sshwarts Exp $
// $Id: init.cc,v 1.47 2003-04-22 20:21:32 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -168,7 +168,7 @@ cpu_param_handler (bx_param_c *param, int set, Bit64s val)
void BX_CPU_C::init(BX_MEM_C *addrspace)
{
BX_DEBUG(( "Init $Id: init.cc,v 1.46 2003-02-13 15:51:22 sshwarts Exp $"));
BX_DEBUG(( "Init $Id: init.cc,v 1.47 2003-04-22 20:21:32 sshwarts Exp $"));
// BX_CPU_C constructor
BX_CPU_THIS_PTR set_INTR (0);
#if BX_SUPPORT_APIC
@ -864,7 +864,9 @@ BX_CPU_C::reset(unsigned source)
#endif
// Init the Floating Point Unit
#if BX_SUPPORT_FPU
fpu_init();
#endif
#if (BX_SMP_PROCESSORS > 1)
// notice if I'm the bootstrap processor. If not, do the equivalent of

View File

@ -72,7 +72,6 @@ A_OBJS =reg_u_add.o reg_u_div.o reg_u_mul.o reg_u_sub.o \
L_OBJS = $(C_OBJS) $(A_OBJS)
OBJS = \
fpu.o \
@FPU_GLUE_OBJ@ \
$(L_OBJS)
@ -171,17 +170,6 @@ round_Xsig.o: round_Xsig.c fpu_emu.h fpu_system.h fpu_proto.h poly.h
shr_Xsig.o: shr_Xsig.c fpu_emu.h fpu_system.h fpu_proto.h poly.h
wm_shrx.o: wm_shrx.c fpu_emu.h fpu_system.h fpu_proto.h
wm_sqrt.o: wm_sqrt.c exception.h fpu_emu.h fpu_system.h fpu_proto.h
fpu.o: fpu.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../debug/debug.h \
../bxversion.h ../gui/siminterface.h ../state_file.h ../cpu/cpu.h \
../cpu/lazy_flags.h ../cpu/i387.h ../memory/memory.h ../pc_system.h \
../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h ../gui/textconfig.h \
../gui/keymap.h ../iodev/iodev.h ../iodev/vga.h ../iodev/biosdev.h \
../iodev/cmos.h ../iodev/dma.h ../iodev/floppy.h ../iodev/harddrv.h \
../iodev/cdrom.h ../iodev/keyboard.h ../iodev/parallel.h \
../iodev/pic.h ../iodev/pit.h ../iodev/pit_wrap.h ../iodev/pit82c54.h \
../iodev/serial.h ../iodev/unmapped.h ../iodev/eth.h ../iodev/ne2k.h \
../iodev/guest2host.h ../iodev/slowdown_timer.h \
../instrument/stubs/instrument.h
wmFPUemu_glue.o: wmFPUemu_glue.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h \
../debug/debug.h ../bxversion.h ../gui/siminterface.h ../state_file.h \
../cpu/cpu.h ../cpu/lazy_flags.h ../cpu/i387.h ../memory/memory.h \

View File

@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------+
| fpu_entry.c |
| $Id: fpu_entry.c,v 1.7 2003-04-16 18:38:52 sshwarts Exp $
| $Id: fpu_entry.c,v 1.8 2003-04-22 20:21:33 sshwarts Exp $
| |
| The entry functions for wm-FPU-emu |
| |
@ -131,7 +131,7 @@ static u_char const type_table[64] = {
asmlinkage void
math_emulate2(fpu_addr_modes addr_modes,
math_emulate(fpu_addr_modes addr_modes,
u_char FPU_modrm,
u_char byte1,
void *data_address,

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu_proto.h,v 1.6 2003-04-16 18:38:52 sshwarts Exp $
// $Id: fpu_proto.h,v 1.7 2003-04-22 20:21:34 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -87,7 +87,6 @@ extern void ffreep(void);
extern void fst_i_(void);
extern void fstp_i(void);
/* fpu_entry.c */
extern void math_emulate(long arg);
extern void math_abort(struct info *info, unsigned int signal);
/* fpu_etc.c */
extern void FPU_etc(void);

View File

@ -55,7 +55,7 @@ static BX_CPU_C *fpu_cpu_ptr = NULL;
i387_t *current_i387;
extern "C" void
math_emulate2(fpu_addr_modes addr_modes,
math_emulate(fpu_addr_modes addr_modes,
u_char FPU_modrm,
u_char byte1,
void *data_address,
@ -129,7 +129,7 @@ BX_CPU_C::fpu_execute(bxInstruction_c *i)
data_sel_off.offset = RMAddr(i);
data_sel_off.selector = BX_CPU_THIS_PTR sregs[i->seg()].selector.value;
math_emulate2(addr_modes, i->modrm(), i->b1(), data_address,
math_emulate(addr_modes, i->modrm(), i->b1(), data_address,
data_sel_off, entry_sel_off);
}
@ -180,7 +180,6 @@ fpu_set_ax(unsigned short val16)
#define AX (fpu_cpu_ptr->gen_reg[0].word.rx)
AX = val16;
#undef AX
//BX_DEBUG(( "fpu_set_ax(0x%04x)", (unsigned) val16));
}
void BX_CPP_AttrRegparmN(3)
@ -196,7 +195,6 @@ fpu_verify_area(unsigned what, void *ptr, unsigned n)
else { // VERIFY_WRITE
fpu_cpu_ptr->write_virtual_checks(seg, PTR2INT(ptr), n);
}
//BX_DEBUG(( "verify_area: 0x%x", PTR2INT(ptr)));
}