use inverted stack mask in normal/full core;
issue exception when calling type zero descriptor; add INVLPG opcode Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2617
This commit is contained in:
parent
eedd8cc98c
commit
19955c36e8
8 changed files with 23 additions and 6 deletions
|
@ -447,12 +447,12 @@ l_M_Ed:
|
|||
goto nextopcode;
|
||||
}
|
||||
case D_LEAVEw:
|
||||
reg_esp&=~cpu.stack.mask;
|
||||
reg_esp&=cpu.stack.notmask;
|
||||
reg_esp|=(reg_ebp&cpu.stack.mask);
|
||||
reg_bp=Pop_16();
|
||||
goto nextopcode;
|
||||
case D_LEAVEd:
|
||||
reg_esp&=~cpu.stack.mask;
|
||||
reg_esp&=cpu.stack.notmask;
|
||||
reg_esp|=(reg_ebp&cpu.stack.mask);
|
||||
reg_ebp=Pop_32();
|
||||
goto nextopcode;
|
||||
|
|
|
@ -450,6 +450,11 @@ switch (inst.code.op) {
|
|||
FillFlags();
|
||||
if (CPU_LMSW(inst_op1_w)) RunException();
|
||||
goto nextopcode;
|
||||
case 7: /* INVLPG */
|
||||
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||
FillFlags();
|
||||
PAGING_ClearTLB();
|
||||
goto nextopcode;
|
||||
default:
|
||||
LOG(LOG_CPU,LOG_ERROR)("Group 7 Illegal subfunction %X",inst.rm_index);
|
||||
goto illegalopcode;
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "callback.h"
|
||||
#include "pic.h"
|
||||
#include "fpu.h"
|
||||
#include "paging.h"
|
||||
|
||||
#if C_DEBUG
|
||||
#include "debug.h"
|
||||
|
|
|
@ -92,6 +92,10 @@
|
|||
limit=LoadMw(eaa);
|
||||
if (CPU_LMSW(limit)) RUNEXCEPTION();
|
||||
break;
|
||||
case 0x07: /* INVLPG */
|
||||
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||
PAGING_ClearTLB();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
GetEArw;Bitu limit;
|
||||
|
|
|
@ -492,7 +492,7 @@
|
|||
}
|
||||
break;
|
||||
CASE_D(0xc9) /* LEAVE */
|
||||
reg_esp&=~cpu.stack.mask;
|
||||
reg_esp&=cpu.stack.notmask;
|
||||
reg_esp|=(reg_ebp&cpu.stack.mask);
|
||||
reg_ebp=Pop_32();
|
||||
break;
|
||||
|
|
|
@ -94,6 +94,10 @@
|
|||
limit=LoadMw(eaa);
|
||||
if (CPU_LMSW((Bit16u)limit)) RUNEXCEPTION();
|
||||
break;
|
||||
case 0x07: /* INVLPG */
|
||||
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||
PAGING_ClearTLB();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
GetEArd;Bitu limit;
|
||||
|
|
|
@ -712,7 +712,7 @@
|
|||
}
|
||||
break;
|
||||
CASE_W(0xc9) /* LEAVE */
|
||||
reg_esp&=~cpu.stack.mask;
|
||||
reg_esp&=cpu.stack.notmask;
|
||||
reg_esp|=(reg_ebp&cpu.stack.mask);
|
||||
reg_bp=Pop_16();
|
||||
break;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: cpu.cpp,v 1.80 2006-04-18 17:44:25 c2woody Exp $ */
|
||||
/* $Id: cpu.cpp,v 1.81 2006-04-27 13:22:27 c2woody Exp $ */
|
||||
|
||||
#include <assert.h>
|
||||
#include "dosbox.h"
|
||||
|
@ -1147,9 +1147,12 @@ call_code:
|
|||
LOG(LOG_CPU,LOG_NORMAL)("CALL:TSS to %X",selector);
|
||||
CPU_SwitchTask(selector,TSwitch_CALL_INT,oldeip);
|
||||
break;
|
||||
case DESC_INVALID:
|
||||
// used by some installers
|
||||
CPU_Exception(EXCEPTION_GP,selector & 0xfffc);
|
||||
return;
|
||||
default:
|
||||
E_Exit("CALL:Descriptor type %x unsupported",call.Type());
|
||||
|
||||
}
|
||||
}
|
||||
assert(1);
|
||||
|
|
Loading…
Add table
Reference in a new issue