diff --git a/src/cpu/386_common.c b/src/cpu/386_common.c index 25afccc95..760e41eaa 100644 --- a/src/cpu/386_common.c +++ b/src/cpu/386_common.c @@ -1683,7 +1683,7 @@ sysexit(uint32_t fetchdat) cpu_cur_status &= ~(CPU_STATUS_NOTFLATSS /* | CPU_STATUS_V86*/); cpu_cur_status |= (CPU_STATUS_USE32 | CPU_STATUS_STACK32 | CPU_STATUS_PMODE); - flushmmucache_cr3(); + flushmmucache_nopc(); set_use32(1); set_stack32(1); @@ -1804,7 +1804,7 @@ sysret(uint32_t fetchdat) cpu_cur_status &= ~(CPU_STATUS_NOTFLATSS /* | CPU_STATUS_V86*/); cpu_cur_status |= (CPU_STATUS_USE32 | CPU_STATUS_STACK32 | CPU_STATUS_PMODE); - flushmmucache_cr3(); + flushmmucache_nopc(); set_use32(1); set_stack32(1); diff --git a/src/cpu/x86_ops_misc.h b/src/cpu/x86_ops_misc.h index bd1139ba4..940e2ea8e 100644 --- a/src/cpu/x86_ops_misc.h +++ b/src/cpu/x86_ops_misc.h @@ -996,7 +996,7 @@ opLOADALL386(uint32_t fetchdat) loadall_load_segment(la_addr + 0xc0, &cpu_state.seg_es); if (CPL == 3 && oldcpl != 3) - flushmmucache_cr3(); + flushmmucache_nopc(); oldcpl = CPL; CLOCK_CYCLES(350); diff --git a/src/cpu/x86_ops_pmode.h b/src/cpu/x86_ops_pmode.h index 7e9f05a63..c8e146450 100644 --- a/src/cpu/x86_ops_pmode.h +++ b/src/cpu/x86_ops_pmode.h @@ -461,7 +461,7 @@ op0F01_common(uint32_t fetchdat, int is32, int is286, int ea32) break; } SEG_CHECK_READ(cpu_state.ea_seg); - flushmmucache_cr3(); + flushmmucache_nopc(); CLOCK_CYCLES(12); PREFETCH_RUN(12, 2, rmdat, 0, 0, 0, 0, ea32); break; diff --git a/src/cpu/x86seg.c b/src/cpu/x86seg.c index 5b0d8b73a..7f630275c 100644 --- a/src/cpu/x86seg.c +++ b/src/cpu/x86seg.c @@ -580,7 +580,7 @@ loadcs(uint16_t seg) do_seg_load(&cpu_state.seg_cs, segdat); use32 = (segdat[3] & 0x40) ? 0x300 : 0; if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -609,7 +609,7 @@ loadcs(uint16_t seg) cpu_state.seg_cs.access = (cpu_state.eflags & VM_FLAG) ? 0xe2 : 0x82; cpu_state.seg_cs.ar_high = 0x10; if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -673,7 +673,7 @@ loadcsjmp(uint16_t seg, uint32_t old_pc) do_seg_load(&cpu_state.seg_cs, segdat); if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -751,7 +751,7 @@ loadcsjmp(uint16_t seg, uint32_t old_pc) CS = seg2; do_seg_load(&cpu_state.seg_cs, segdat); if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -794,7 +794,7 @@ loadcsjmp(uint16_t seg, uint32_t old_pc) cpu_state.seg_cs.access = (cpu_state.eflags & VM_FLAG) ? 0xe2 : 0x82; cpu_state.seg_cs.ar_high = 0x10; if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -957,7 +957,7 @@ loadcscall(uint16_t seg) CS = seg; do_seg_load(&cpu_state.seg_cs, segdat); if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -1100,7 +1100,7 @@ loadcscall(uint16_t seg) CS = seg2; do_seg_load(&cpu_state.seg_cs, segdat); if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -1182,7 +1182,7 @@ loadcscall(uint16_t seg) CS = seg2; do_seg_load(&cpu_state.seg_cs, segdat); if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -1227,7 +1227,7 @@ loadcscall(uint16_t seg) cpu_state.seg_cs.access = (cpu_state.eflags & VM_FLAG) ? 0xe2 : 0x82; cpu_state.seg_cs.ar_high = 0x10; if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -1332,7 +1332,7 @@ pmoderetf(int is32, uint16_t off) do_seg_load(&cpu_state.seg_cs, segdat); cpu_state.seg_cs.access = (cpu_state.seg_cs.access & ~(3 << 5)) | ((CS & 3) << 5); if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -1445,7 +1445,7 @@ pmoderetf(int is32, uint16_t off) CS = seg; do_seg_load(&cpu_state.seg_cs, segdat); if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -1697,7 +1697,7 @@ pmodeint(int num, int soft) CS = (seg & 0xfffc) | new_cpl; cpu_state.seg_cs.access = (cpu_state.seg_cs.access & ~0x60) | (new_cpl << 5); if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -1863,7 +1863,7 @@ pmodeiret(int is32) cpu_state.seg_cs.access = 0xe2; cpu_state.seg_cs.ar_high = 0x10; if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -1948,7 +1948,7 @@ pmodeiret(int is32) do_seg_load(&cpu_state.seg_cs, segdat); cpu_state.seg_cs.access = (cpu_state.seg_cs.access & ~0x60) | ((CS & 0x0003) << 5); if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -2037,7 +2037,7 @@ pmodeiret(int is32) do_seg_load(&cpu_state.seg_cs, segdat); cpu_state.seg_cs.access = (cpu_state.seg_cs.access & ~0x60) | ((CS & 3) << 5); if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -2233,7 +2233,7 @@ taskswitch286(uint16_t seg, uint16_t *segdat, int is32) CS = new_cs; do_seg_load(&cpu_state.seg_cs, segdat2); if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif @@ -2401,7 +2401,7 @@ taskswitch286(uint16_t seg, uint16_t *segdat, int is32) CS = new_cs; do_seg_load(&cpu_state.seg_cs, segdat2); if ((CPL == 3) && (oldcpl != 3)) - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef USE_NEW_DYNAREC oldcpl = CPL; #endif diff --git a/src/include/86box/mem.h b/src/include/86box/mem.h index 4bdf185af..45520f709 100644 --- a/src/include/86box/mem.h +++ b/src/include/86box/mem.h @@ -157,8 +157,6 @@ mem_set_access((smm ? ACCESS_CPU_SMM : ACCESS_CPU), 1, base, size, is_smram) #define mem_set_access_smram_bus(smm, base, size, is_smram) \ mem_set_access((smm ? ACCESS_BUS_SMM : ACCESS_BUS), 1, base, size, is_smram) -#define flushmmucache_cr3 \ - flushmmucache_nopc typedef struct { uint16_t x : 5, diff --git a/src/mem/mem.c b/src/mem/mem.c index 68a66922f..98acd8c97 100644 --- a/src/mem/mem.c +++ b/src/mem/mem.c @@ -2319,7 +2319,7 @@ mem_mapping_recalc(uint64_t base, uint64_t size) map = map->next; } - flushmmucache_cr3(); + flushmmucache_nopc(); #ifdef ENABLE_MEM_LOG pclog("\nMemory map:\n"); diff --git a/src/video/vid_sigma.c b/src/video/vid_sigma.c index 125626007..148dcc81c 100644 --- a/src/video/vid_sigma.c +++ b/src/video/vid_sigma.c @@ -246,7 +246,7 @@ sigma_out(uint16_t addr, uint8_t val, void *p) return; case 0x2DD: /* Page in RAM at 0xC1800 */ if (sigma->rom_paged != 0) - flushmmucache_cr3(); + flushmmucache_nopc(); sigma->rom_paged = 0x00; return; @@ -290,7 +290,7 @@ sigma_in(uint16_t addr, void *p) case 0x2DD: /* Page in ROM at 0xC1800 */ result = (sigma->rom_paged ? 0x80 : 0); if (sigma->rom_paged != 0x80) - flushmmucache_cr3(); + flushmmucache_nopc(); sigma->rom_paged = 0x80; break; case 0x3D1: