setCR3 change

This commit is contained in:
Stanislav Shwartsman 2010-03-25 21:38:33 +00:00
parent f5ce2a7639
commit 2279b770e2

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: tasking.cc,v 1.87 2010-03-25 21:33:07 sshwarts Exp $
// $Id: tasking.cc,v 1.88 2010-03-25 21:38:33 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2010 The Bochs Project
@ -467,7 +467,8 @@ void BX_CPU_C::task_switch(bxInstruction_c *i, bx_selector_t *tss_selector,
if ((tss_descriptor->type >= 9) && BX_CPU_THIS_PTR cr0.get_PG()) {
// change CR3 only if it actually modified
if (newCR3 != BX_CPU_THIS_PTR cr3) {
SetCR3(newCR3); // Tell paging unit about new cr3 value
if (! SetCR3(newCR3)) // Tell paging unit about new cr3 value
exception(BX_GP_EXCEPTION, 0);
BX_DEBUG(("task_switch changing CR3 to 0x" FMT_PHY_ADDRX, newCR3));
BX_INSTR_TLB_CNTRL(BX_CPU_ID, BX_INSTR_TASKSWITCH, newCR3);
}