Fixed compilation errors, added BX_ASSERT in paging.cc

This commit is contained in:
Stanislav Shwartsman 2008-08-18 05:20:23 +00:00
parent 56504e4a67
commit 5e92a1642d
4 changed files with 17 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.cc,v 1.237 2008-08-14 22:26:14 sshwarts Exp $
// $Id: cpu.cc,v 1.238 2008-08-18 05:20:22 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -610,8 +610,7 @@ unsigned BX_CPU_C::handleAsyncEvent(void)
void BX_CPU_C::prefetch(void)
{
bx_address temp_rip = RIP;
bx_address laddr = BX_CPU_THIS_PTR get_laddr(BX_SEG_REG_CS, temp_rip);
bx_address laddr = BX_CPU_THIS_PTR get_laddr(BX_SEG_REG_CS, RIP);
bx_phy_address pAddr;
unsigned pageOffset = PAGE_OFFSET(laddr);
@ -630,8 +629,8 @@ void BX_CPU_C::prefetch(void)
#endif
{
Bit32u temp_limit = BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.limit_scaled;
if (((Bit32u) temp_rip) > temp_limit) {
BX_ERROR(("prefetch: EIP [%08x] > CS.limit [%08x]", (Bit32u) temp_rip, temp_limit));
if (EIP > temp_limit) {
BX_ERROR(("prefetch: EIP [%08x] > CS.limit [%08x]", EIP, temp_limit));
exception(BX_GP_EXCEPTION, 0, 0);
}
if (temp_limit + BX_CPU_THIS_PTR eipPageBias < 4096) {

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.510 2008-08-16 21:06:56 sshwarts Exp $
// $Id: cpu.h,v 1.511 2008-08-18 05:20:23 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -1681,9 +1681,11 @@ public: // for now...
#if BX_SUPPORT_X86_64
BX_SMF void LOAD_Eq(bxInstruction_c *) BX_CPP_AttrRegparmN(1);
#endif
#if BX_SUPPORT_SSE >= 1
BX_SMF void LOAD_Wss(bxInstruction_c *) BX_CPP_AttrRegparmN(1);
BX_SMF void LOAD_Wsd(bxInstruction_c *) BX_CPP_AttrRegparmN(1);
BX_SMF void LOAD_Wdq(bxInstruction_c *) BX_CPP_AttrRegparmN(1);
#endif
#if BX_SUPPORT_FPU == 0 // if FPU is disabled
BX_SMF void FPU_ESC(bxInstruction_c *) BX_CPP_AttrRegparmN(1);
@ -3309,11 +3311,13 @@ BX_CPP_INLINE void BX_CPU_C::prepareXSAVE(void)
BX_CPP_INLINE void BX_CPU_C::updateFetchModeMask(void)
{
#if BX_SUPPORT_ICACHE
BX_CPU_THIS_PTR fetchModeMask =
#if BX_SUPPORT_X86_64
((BX_CPU_THIS_PTR cpu_mode == BX_MODE_LONG_64)<<30) |
#endif
(BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.d_b << 31);
#endif
BX_CPU_THIS_PTR user_pl = // CPL == 3
(BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.rpl == 3);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: data_xfer.cc,v 1.4 2008-08-11 20:34:05 sshwarts Exp $
// $Id: data_xfer.cc,v 1.5 2008-08-18 05:20:23 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2008 Stanislav Shwartsman
@ -56,6 +56,8 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::LOAD_Eq(bxInstruction_c *i)
}
#endif
#if BX_SUPPORT_SSE >= 1
void BX_CPP_AttrRegparmN(1) BX_CPU_C::LOAD_Wdq(bxInstruction_c *i)
{
bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
@ -78,3 +80,5 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::LOAD_Wsd(bxInstruction_c *i)
BX_WRITE_XMM_REG_LO_QWORD(BX_TMP_REGISTER, val_64);
BX_CPU_CALL_METHOD(i->execute2, (i));
}
#endif

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: paging.cc,v 1.154 2008-08-16 15:35:35 sshwarts Exp $
// $Id: paging.cc,v 1.155 2008-08-18 05:20:23 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -939,6 +939,8 @@ bx_phy_address BX_CPU_C::translate_linear(bx_address laddr, unsigned curr_pl, un
bx_bool isWrite = (rw >= BX_WRITE); // write or r-m-w
unsigned pl = (curr_pl == 3);
BX_ASSERT(BX_CPU_THIS_PTR cr0.get_PG());
InstrTLB_Increment(tlbLookups);
InstrTLB_Stats();