Fixed problem introduced by prev checkin

+
Fix beak to debugger when executing HLT instruction
This commit is contained in:
Stanislav Shwartsman 2008-02-29 05:39:40 +00:00
parent 405fcfd75d
commit 5e7218b8c3
4 changed files with 17 additions and 13 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.cc,v 1.207 2008-02-15 22:05:39 sshwarts Exp $
// $Id: cpu.cc,v 1.208 2008-02-29 05:39:38 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -332,11 +332,7 @@ unsigned BX_CPU_C::handleAsyncEvent(void)
// I made up the bitmask above to mean HALT state.
// for one processor, pass the time as quickly as possible until
// an interrupt wakes up the CPU.
#if BX_DEBUGGER
while (bx_guard.interrupt_requested != 1)
#else
while (1)
#endif
{
if ((BX_CPU_INTR && (BX_CPU_THIS_PTR get_IF() || (BX_CPU_THIS_PTR debug_trap & BX_DEBUG_TRAP_MWAIT_IF))) ||
BX_CPU_THIS_PTR nmi_pending || BX_CPU_THIS_PTR smi_pending)
@ -354,6 +350,7 @@ unsigned BX_CPU_C::handleAsyncEvent(void)
BX_INFO(("handleAsyncEvent: reset detected in HLT state"));
break;
}
// for multiprocessor simulation, even if this CPU is halted we still
// must give the others a chance to simulate. If an interrupt has
// arrived, then clear the HALT condition; otherwise just return from
@ -367,6 +364,12 @@ unsigned BX_CPU_C::handleAsyncEvent(void)
return 1; // Return to caller of cpu_loop.
}
#endif
#if BX_DEBUGGER
if (bx_guard.interrupt_requested)
return 1; // Return to caller of cpu_loop.
#endif
BX_TICK1();
}
} else if (bx_pc_system.kill_bochs_request) {

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fetchdecode.cc,v 1.168 2008-02-29 03:02:03 sshwarts Exp $
// $Id: fetchdecode.cc,v 1.169 2008-02-29 05:39:38 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -2569,7 +2569,7 @@ fetch_b1:
#if (BX_SUPPORT_SSE >= 4) || (BX_SUPPORT_SSE >= 3 && BX_SUPPORT_SSE_EXTENSION > 0)
unsigned b3 = 0;
// handle 3-byte escape
if (attr & Bx3ByteOp) {
if ((attr & BxGroupX) == Bx3ByteOp) {
if (ilen < remain) {
ilen++;
b3 = *iptr++;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fetchdecode64.cc,v 1.175 2008-02-29 03:02:03 sshwarts Exp $
// $Id: fetchdecode64.cc,v 1.176 2008-02-29 05:39:39 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -3505,7 +3505,7 @@ fetch_b1:
#if (BX_SUPPORT_SSE >= 4) || (BX_SUPPORT_SSE >= 3 && BX_SUPPORT_SSE_EXTENSION > 0)
unsigned b3 = 0;
// handle 3-byte escape
if (attr & Bx3ByteOp) {
if ((attr & BxGroupX) == Bx3ByteOp) {
if (ilen < remain) {
ilen++;
b3 = *iptr++;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: dis_decode.cc,v 1.44 2008-02-29 03:02:03 sshwarts Exp $
// $Id: dis_decode.cc,v 1.45 2008-02-29 05:39:40 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
#include <stdio.h>
@ -204,11 +204,12 @@ x86_insn disassembler::decode(bx_bool is_32, bx_bool is_64, bx_address base, bx_
entry = opcode_table + insn.b1;
// will require 3rd byte for 3-byte opcode
if (entry->Attr & _GRP3BOP) b3 = fetch_byte();
if (instruction_has_modrm[insn.b1])
{
// will require 3rd byte for 3-byte opcode
if (entry->Attr == _GRP3BOP)
b3 = fetch_byte();
decode_modrm(&insn);
}