mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-05-09 03:41:10 +08:00
Add CR4 register
This commit is contained in:
parent
14c0fae9e7
commit
7e1756b8f5
@ -539,6 +539,7 @@ struct CPUBlock {
|
||||
Bitu cpl; /* Current Privilege */
|
||||
Bitu mpl;
|
||||
Bitu cr0;
|
||||
Bitu cr4;
|
||||
bool pmode; /* Is Protected mode enabled */
|
||||
GDTDescriptorTable gdt;
|
||||
DescriptorTable idt;
|
||||
|
@ -2505,6 +2505,9 @@ void CPU_SET_CRX(Bitu cr,Bitu value) {
|
||||
case 3:
|
||||
PAGING_SetDirBase(value);
|
||||
break;
|
||||
case 4:
|
||||
cpu.cr4=value;
|
||||
break;
|
||||
default:
|
||||
LOG(LOG_CPU,LOG_ERROR)("Unhandled MOV CR%d,%X",cr,value);
|
||||
break;
|
||||
@ -2532,6 +2535,8 @@ Bitu CPU_GET_CRX(Bitu cr) {
|
||||
return paging.cr2;
|
||||
case 3:
|
||||
return PAGING_GetDirBase() & 0xfffff000;
|
||||
case 4:
|
||||
return cpu.cr4;
|
||||
default:
|
||||
LOG(LOG_CPU,LOG_ERROR)("Unhandled MOV XXX, CR%d",cr);
|
||||
break;
|
||||
@ -3342,8 +3347,10 @@ public:
|
||||
SegSet16(ss,0); Segs.limit[ss] = do_seg_limits ? 0xFFFF : ((PhysPt)(~0UL)); Segs.expanddown[ss] = false;
|
||||
|
||||
CPU_SetFlags(FLAG_IF,FMASK_ALL); //Enable interrupts
|
||||
cpu.cr0=0xffffffff;
|
||||
cpu.cr0=0x00000000;
|
||||
cpu.cr4=0xffffffff;
|
||||
CPU_SET_CRX(0,0); //Initialize
|
||||
CPU_SET_CRX(4,0);
|
||||
cpu.code.big=false;
|
||||
cpu.stack.mask=0xffff;
|
||||
cpu.stack.notmask=0xffff0000;
|
||||
|
Loading…
x
Reference in New Issue
Block a user