More PAGEBLOCKS support

This commit is contained in:
Jeff Parsons 2015-04-29 09:45:03 -07:00 committed by jeffpar
commit 453d84c6d8
7 changed files with 252 additions and 48 deletions

View file

@ -3461,6 +3461,26 @@ X86.fnFault = function(nFault, nError, fHalt)
this.opFlags &= ~(X86.OPFLAG.NOREAD | X86.OPFLAG.NOWRITE);
};
/**
* fnPageFault(addr, fPresent, fWrite)
*
* Helper to dispatch page faults.
*
* @this {X86CPU}
* @param {number} addr
* @param {boolean} fPresent
* @param {boolean} fWrite
*/
X86.fnPageFault = function(addr, fPresent, fWrite)
{
this.regCR2 = addr;
var nError = 0;
if (fPresent) nError |= X86.PTE.PRESENT;
if (fWrite) nError |= X86.PTE.READWRITE;
if (this.segCS.cpl == 3) nError |= X86.PTE.USER;
X86.fnFault.call(this, X86.EXCEPTION.PG_FAULT, nError);
};
/**
* fnFaultMessage()
*