Fixed small performance bug in HandleAsyncEvent

This commit is contained in:
Stanislav Shwartsman 2008-08-12 19:25:42 +00:00
parent 8ecea83f02
commit fa49bd17dc
3 changed files with 14 additions and 11 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.cc,v 1.235 2008-08-07 22:14:38 sshwarts Exp $
// $Id: cpu.cc,v 1.236 2008-08-12 19:25:42 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -506,7 +506,7 @@ unsigned BX_CPU_C::handleAsyncEvent(void)
interrupt(vector, 0, 0, 0);
// Set up environment, as would be when this main cpu loop gets
// invoked. At the end of normal instructions, we always commmit
// the new EIP/ESP values. But here, we call interrupt() much like
// the new EIP. But here, we call interrupt() much like
// it was a sofware interrupt instruction, and need to effect the
// commit here. This code mirrors similar code above.
BX_CPU_THIS_PTR prev_rip = RIP; // commit new RIP
@ -586,7 +586,7 @@ unsigned BX_CPU_C::handleAsyncEvent(void)
// will be processed on the next boundary.
BX_CPU_THIS_PTR inhibit_mask = 0;
if (!(BX_CPU_INTR ||
if (!((BX_CPU_INTR && BX_CPU_THIS_PTR get_IF()) ||
BX_CPU_THIS_PTR debug_trap ||
BX_HRQ ||
BX_CPU_THIS_PTR get_TF()

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: flag_ctrl_pro.cc,v 1.34 2008-04-25 08:19:36 sshwarts Exp $
// $Id: flag_ctrl_pro.cc,v 1.35 2008-08-12 19:25:42 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -41,6 +41,15 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::setEFlags(Bit32u val)
}
#endif
if (val & EFlagsTFMask) {
BX_CPU_THIS_PTR async_event = 1; // TF = 1
}
if (val & EFlagsIFMask) {
if (! BX_CPU_THIS_PTR get_IF())
BX_CPU_THIS_PTR async_event = 1; // IF bit was set
}
BX_CPU_THIS_PTR eflags = val;
BX_CPU_THIS_PTR lf_flags_status = 0; // OSZAPC flags are known.
@ -71,10 +80,6 @@ BX_CPU_C::writeEFlags(Bit32u flags, Bit32u changeMask)
(flags & changeMask);
setEFlags(newEFlags);
// OSZAPC flags are known - done in setEFlags(newEFlags)
if (newEFlags & EFlagsTFMask) {
BX_CPU_THIS_PTR async_event = 1; // TF = 1
}
}
void BX_CPP_AttrRegparmN(3)

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: icache.cc,v 1.15 2008-07-17 17:28:25 sshwarts Exp $
// $Id: icache.cc,v 1.16 2008-08-12 19:25:42 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2007 Stanislav Shwartsman
@ -96,8 +96,6 @@ void BX_CPU_C::serveICacheMiss(bxICacheEntry_c *cache_entry, Bit32u eipBiased, b
bxInstruction_c *i = cache_entry->i;
if (BX_CPU_THIS_PTR async_event) max_length = 1;
for (unsigned n=0;n<max_length;n++)
{
#if BX_SUPPORT_X86_64