don't crash when running on 386 with no FPU model
This commit is contained in:
parent
601493c89a
commit
080ceb8293
@ -42,6 +42,9 @@ bx_cpuid_t::bx_cpuid_t(BX_CPU_C *_cpu): cpu(_cpu)
|
||||
|
||||
for (unsigned n=0; n < BX_ISA_EXTENSIONS_ARRAY_SIZE; n++)
|
||||
ia_extensions_bitmask[n] = 0;
|
||||
|
||||
// every cpu supported by Bochs support all 386 and earlier instructions
|
||||
ia_extensions_bitmask[0] = (1 << BX_ISA_386);
|
||||
}
|
||||
|
||||
#if BX_SUPPORT_APIC
|
||||
|
@ -32,7 +32,8 @@ struct cpuid_function_t {
|
||||
};
|
||||
|
||||
enum {
|
||||
BX_ISA_X87 = 0, /* FPU (X87) instruction */
|
||||
BX_ISA_386 = 0, /* 386 or earlier instruction */
|
||||
BX_ISA_X87, /* FPU (X87) instruction */
|
||||
BX_ISA_486, /* 486 new instruction */
|
||||
BX_ISA_PENTIUM, /* Pentium new instruction */
|
||||
BX_ISA_P6, /* P6 new instruction */
|
||||
|
@ -49,6 +49,7 @@ BX_CPU_C::BX_CPU_C(unsigned id): bx_cpuid(id)
|
||||
for (unsigned n=0;n<BX_ISA_EXTENSIONS_ARRAY_SIZE;n++)
|
||||
ia_extensions_bitmask[n] = 0;
|
||||
|
||||
ia_extensions_bitmask[0] = (1 << BX_ISA_386);
|
||||
if (BX_SUPPORT_FPU)
|
||||
ia_extensions_bitmask[0] = (1 << BX_ISA_X87);
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2009-2014 Stanislav Shwartsman
|
||||
// Copyright (c) 2009-2015 Stanislav Shwartsman
|
||||
// Written by Stanislav Shwartsman [sshwarts at sourceforge net]
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
|
@ -40,7 +40,8 @@
|
||||
|
||||
/* Instruction set attributes (duplicated in cpu.h) */
|
||||
enum {
|
||||
IA_X87 = 0, /* FPU (X87) instruction */
|
||||
IA_386 = 0, /* 386 or earlier instruction */
|
||||
IA_X87, /* FPU (X87) instruction */
|
||||
IA_486, /* 486 new instruction */
|
||||
IA_PENTIUM, /* Pentium new instruction */
|
||||
IA_P6, /* P6 new instruction */
|
||||
|
Loading…
x
Reference in New Issue
Block a user