From 28530c83dc4a28dc463f94077fd530c68f362db1 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 28 Apr 2020 18:37:19 +0200 Subject: [PATCH] Slight changes related to PAE. --- src/cpu_common/x86_ops_mov_ctrl.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/cpu_common/x86_ops_mov_ctrl.h b/src/cpu_common/x86_ops_mov_ctrl.h index c1c9b623f..dd224608c 100644 --- a/src/cpu_common/x86_ops_mov_ctrl.h +++ b/src/cpu_common/x86_ops_mov_ctrl.h @@ -120,9 +120,9 @@ static int opMOV_CRx_r_a16(uint32_t fetchdat) mmu_perm=4; if (hascache && !(cr0 & (1 << 30))) cpu_cache_int_enabled = 1; - else - cpu_cache_int_enabled = 0; - if (hascache && ((cr0 ^ old_cr0) & (1 << 30))) + else + cpu_cache_int_enabled = 0; + if (hascache && ((cr0 ^ old_cr0) & (1 << 30))) cpu_update_waitstates(); if (cr0 & 1) cpu_cur_status |= CPU_STATUS_PMODE; @@ -139,8 +139,8 @@ static int opMOV_CRx_r_a16(uint32_t fetchdat) case 4: if (cpu_has_feature(CPU_FEATURE_CR4)) { - if (cpu_state.regs[cpu_rm].l & 0x00000020) - fatal("PAE enable\n"); + if (((cpu_state.regs[cpu_rm].l ^ cr4) & cpu_CR4_mask) & CR4_PAE) + flushmmucache(); cr4 = cpu_state.regs[cpu_rm].l & cpu_CR4_mask; break; } @@ -195,6 +195,8 @@ static int opMOV_CRx_r_a32(uint32_t fetchdat) case 4: if (cpu_has_feature(CPU_FEATURE_CR4)) { + if (((cpu_state.regs[cpu_rm].l ^ cr4) & cpu_CR4_mask) & CR4_PAE) + flushmmucache(); cr4 = cpu_state.regs[cpu_rm].l & cpu_CR4_mask; break; }