diff --git a/bochs/cpu/cpu.cc b/bochs/cpu/cpu.cc index 7f5ad8f67..b462b0e5c 100644 --- a/bochs/cpu/cpu.cc +++ b/bochs/cpu/cpu.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: cpu.cc,v 1.241 2008-09-24 10:39:35 sshwarts Exp $ +// $Id: cpu.cc,v 1.242 2008-09-26 20:41:41 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -573,7 +573,15 @@ unsigned BX_CPU_C::handleAsyncEvent(void) // boundary. (becomes a trap) if (! (BX_CPU_THIS_PTR inhibit_mask & BX_INHIBIT_DEBUG)) { // Commit debug events to DR6 - BX_CPU_THIS_PTR dr6 = BX_CPU_THIS_PTR debug_trap; +#if BX_CPU_LEVEL <= 4 + // On 386/486 bit12 is settable + BX_CPU_THIS_PTR dr6 = (BX_CPU_THIS_PTR dr6 & 0xffff0ff0) | + (BX_CPU_THIS_PTR debug_trap & 0x0000f00f); +#else + // On Pentium+, bit12 is always zero + BX_CPU_THIS_PTR dr6 = (BX_CPU_THIS_PTR dr6 & 0xffff0ff0) | + (BX_CPU_THIS_PTR debug_trap & 0x0000e00f); +#endif exception(BX_DB_EXCEPTION, 0, 0); // no error, not interrupt } }