comp fixes

This commit is contained in:
Stanislav Shwartsman 2010-05-06 21:46:39 +00:00
parent 60a6476e40
commit b0d5142e18
4 changed files with 51 additions and 20 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.672 2010-04-29 19:34:32 sshwarts Exp $
// $Id: cpu.h,v 1.673 2010-05-06 21:46:39 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2010 The Bochs Project
@ -2807,9 +2807,9 @@ public: // for now...
BX_SMF bx_bool dbg_instruction_epilog(void);
#endif
#if BX_DEBUGGER || BX_DISASM || BX_INSTRUMENTATION || BX_GDBSTUB
BX_SMF bx_bool dbg_xlate_linear2phy(bx_address linear, bx_phy_address *phy);
BX_SMF bx_bool dbg_xlate_linear2phy(bx_address linear, bx_phy_address *phy, bx_bool verbose = 0);
#if BX_SUPPORT_VMX >= 2
BX_SMF bx_bool dbg_translate_guest_physical(bx_phy_address guest_paddr, bx_phy_address *phy);
BX_SMF bx_bool dbg_translate_guest_physical(bx_phy_address guest_paddr, bx_phy_address *phy, bx_bool verbose = 0);
#endif
#endif
BX_SMF void atexit(void);
@ -3275,6 +3275,10 @@ public: // for now...
#endif
BX_SMF BX_CPP_INLINE int bx_cpuid_support_1g_paging(void);
BX_SMF BX_CPP_INLINE int bx_cpuid_support_vme(void);
BX_SMF BX_CPP_INLINE int bx_cpuid_support_pae(void);
BX_SMF BX_CPP_INLINE int bx_cpuid_support_pge(void);
BX_SMF BX_CPP_INLINE int bx_cpuid_support_pse36(void);
BX_SMF BX_CPP_INLINE int bx_cpuid_support_pcid(void);
BX_SMF BX_CPP_INLINE unsigned which_cpu(void) { return BX_CPU_THIS_PTR bx_cpuid; }
@ -3690,15 +3694,6 @@ BX_CPP_INLINE bx_bool BX_CPU_C::alignment_check(void)
}
#endif
BX_CPP_INLINE int BX_CPU_C::bx_cpuid_support_1g_paging(void)
{
#if BX_SUPPORT_X86_64
return (BX_CPU_THIS_PTR cpuid_ext_function[1].edx >> 26) & 0x1;
#else
return 0;
#endif
}
BX_CPP_INLINE int BX_CPU_C::bx_cpuid_support_pcid(void)
{
#if BX_SUPPORT_X86_64
@ -3708,7 +3703,34 @@ BX_CPP_INLINE int BX_CPU_C::bx_cpuid_support_pcid(void)
#endif
}
BOCHSAPI extern const Bit8u bx_parity_lookup[256];
BX_CPP_INLINE int BX_CPU_C::bx_cpuid_support_vme(void)
{
return (BX_CPU_THIS_PTR cpuid_std_function[1].edx >> 1) & 0x1;
}
BX_CPP_INLINE int BX_CPU_C::bx_cpuid_support_pae(void)
{
return (BX_CPU_THIS_PTR cpuid_std_function[1].edx >> 6) & 0x1;
}
BX_CPP_INLINE int BX_CPU_C::bx_cpuid_support_pge(void)
{
return (BX_CPU_THIS_PTR cpuid_std_function[1].edx >> 13) & 0x1;
}
BX_CPP_INLINE int BX_CPU_C::bx_cpuid_support_pse36(void)
{
return (BX_CPU_THIS_PTR cpuid_std_function[1].edx >> 17) & 0x1;
}
BX_CPP_INLINE int BX_CPU_C::bx_cpuid_support_1g_paging(void)
{
#if BX_SUPPORT_X86_64
return (BX_CPU_THIS_PTR cpuid_ext_function[1].edx >> 26) & 0x1;
#else
return 0;
#endif
}
BX_CPP_INLINE void BX_CPU_C::set_PF_base(Bit8u val)
{

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpuid.cc,v 1.115 2010-04-29 19:34:32 sshwarts Exp $
// $Id: cpuid.cc,v 1.116 2010-05-06 21:46:39 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2007-2010 Stanislav Shwartsman
@ -298,6 +298,7 @@ Bit32u BX_CPU_C::get_std_cpuid_features(void)
features |= (1<<15); // support CMOV instructions
features |= (1<<16); // support PAT
features |= (1<<17); // support PSE-36
features |= (1<<22); // support ACPI
}
if (BX_CPU_SUPPORT_ISA_EXTENSION(BX_CPU_FXSAVE_FXRSTOR))

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: crregs.cc,v 1.15 2010-05-02 15:10:27 sshwarts Exp $
// $Id: crregs.cc,v 1.16 2010-05-06 21:46:39 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2010 Stanislav Shwartsman
@ -926,7 +926,9 @@ Bit32u BX_CPU_C::get_cr4_allow_mask(void)
// [0] VME: Virtual-8086 Mode Extensions R/W
#if BX_CPU_LEVEL >= 5
allowMask |= BX_CR4_VME_MASK | BX_CR4_PVI_MASK; /* VME */
/* VME */
if (bx_cpuid_support_vme())
allowMask |= BX_CR4_VME_MASK | BX_CR4_PVI_MASK;
#endif
#if BX_CPU_LEVEL >= 5
@ -936,11 +938,13 @@ Bit32u BX_CPU_C::get_cr4_allow_mask(void)
allowMask |= BX_CR4_DE_MASK;
#if BX_CPU_LEVEL >= 5
allowMask |= BX_CR4_PSE_MASK;
if (bx_cpuid_support_pse36())
allowMask |= BX_CR4_PSE_MASK;
#endif
#if BX_CPU_LEVEL >= 6
allowMask |= BX_CR4_PAE_MASK;
if (bx_cpuid_support_pae())
allowMask |= BX_CR4_PAE_MASK;
#endif
#if BX_CPU_LEVEL >= 5
@ -949,7 +953,9 @@ Bit32u BX_CPU_C::get_cr4_allow_mask(void)
#endif
#if BX_CPU_LEVEL >= 6
allowMask |= BX_CR4_PGE_MASK;
if (bx_cpuid_support_pge())
allowMask |= BX_CR4_PGE_MASK;
allowMask |= BX_CR4_PCE_MASK;
/* OSFXSR */

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: lazy_flags.h,v 1.38 2010-04-15 05:51:00 sshwarts Exp $
// $Id: lazy_flags.h,v 1.39 2010-05-06 21:46:39 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2009 The Bochs Project
@ -249,4 +249,6 @@ typedef struct {
SET_FLAGS_OSZAP_RESULT_SIZE(64, (result), BX_LF_INSTR_DEC64)
#endif
BOCHSAPI extern const Bit8u bx_parity_lookup[256];
#endif // BX_LAZY_FLAGS_DEF