More reorganization and finally merged the two makefiles.
This commit is contained in:
@@ -24,10 +24,13 @@
|
||||
#include "386_common.h"
|
||||
#include "x86_flags.h"
|
||||
#include "x86seg.h"
|
||||
|
||||
#ifdef USE_DYNAREC
|
||||
#include "codegen.h"
|
||||
|
||||
|
||||
#define CPU_BLOCK_END() cpu_block_end = 1
|
||||
#else
|
||||
#define CPU_BLOCK_END()
|
||||
#endif
|
||||
|
||||
|
||||
x86seg gdt, ldt, idt, tr;
|
||||
@@ -1564,7 +1567,9 @@ sysenter(uint32_t fetchdat)
|
||||
return 1;
|
||||
do_seg_load(&cpu_state.seg_ss, seg_data);
|
||||
cpu_state.seg_ss.checked = 0;
|
||||
#ifdef USE_DYNAREC
|
||||
codegen_flat_ss = 0;
|
||||
#endif
|
||||
if (cpu_state.seg_ss.base == 0 && cpu_state.seg_ss.limit_low == 0 &&
|
||||
cpu_state.seg_ss.limit_high == 0xffffffff)
|
||||
cpu_cur_status &= ~CPU_STATUS_NOTFLATSS;
|
||||
@@ -1657,7 +1662,9 @@ sysexit(uint32_t fetchdat)
|
||||
return 1;
|
||||
do_seg_load(&cpu_state.seg_ss, seg_data);
|
||||
cpu_state.seg_ss.checked = 0;
|
||||
#ifdef USE_DYNAREC
|
||||
codegen_flat_ss = 0;
|
||||
#endif
|
||||
if (cpu_state.seg_ss.base == 0 && cpu_state.seg_ss.limit_low == 0 &&
|
||||
cpu_state.seg_ss.limit_high == 0xffffffff)
|
||||
cpu_cur_status &= ~CPU_STATUS_NOTFLATSS;
|
||||
@@ -1725,7 +1732,9 @@ syscall(uint32_t fetchdat)
|
||||
return 1;
|
||||
do_seg_load(&cpu_state.seg_ss, seg_data);
|
||||
cpu_state.seg_ss.checked = 0;
|
||||
#ifdef USE_DYNAREC
|
||||
codegen_flat_ss = 0;
|
||||
#endif
|
||||
if (cpu_state.seg_ss.base == 0 && cpu_state.seg_ss.limit_low == 0 &&
|
||||
cpu_state.seg_ss.limit_high == 0xffffffff)
|
||||
cpu_cur_status &= ~CPU_STATUS_NOTFLATSS;
|
||||
@@ -1782,7 +1791,9 @@ sysret(uint32_t fetchdat)
|
||||
return 1;
|
||||
do_seg_load(&cpu_state.seg_ss, seg_data);
|
||||
cpu_state.seg_ss.checked = 0;
|
||||
#ifdef USE_DYNAREC
|
||||
codegen_flat_ss = 0;
|
||||
#endif
|
||||
if (cpu_state.seg_ss.base == 0 && cpu_state.seg_ss.limit_low == 0 &&
|
||||
cpu_state.seg_ss.limit_high == 0xffffffff)
|
||||
cpu_cur_status &= ~CPU_STATUS_NOTFLATSS;
|
||||
@@ -1797,3 +1808,13 @@ sysret(uint32_t fetchdat)
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#ifndef USE_DYNAREC
|
||||
/* This is for compatibility with new x87 code. */
|
||||
void codegen_set_rounding_mode(int mode)
|
||||
{
|
||||
/* cpu_state.new_npxc = (cpu_state.old_npxc & ~0xc00) | (cpu_state.npxc & 0xc00); */
|
||||
cpu_state.new_npxc = (cpu_state.old_npxc & ~0xc00) | (mode << 10);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -953,7 +953,6 @@ reset_common(int hard)
|
||||
makeznptable();
|
||||
resetreadlookup();
|
||||
makemod1table();
|
||||
resetmcr();
|
||||
pfq_clear();
|
||||
cpu_set_edx();
|
||||
mmu_perm = 4;
|
||||
@@ -984,6 +983,8 @@ reset_common(int hard)
|
||||
ppi_reset();
|
||||
}
|
||||
in_sys = 0;
|
||||
|
||||
shadowbios = shadowbios_write = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1398,7 +1398,9 @@ cpu_set(void)
|
||||
cpu_features = CPU_FEATURE_RDTSC | CPU_FEATURE_MSR | CPU_FEATURE_CR4 | CPU_FEATURE_VME | CPU_FEATURE_MMX | CPU_FEATURE_3DNOW;
|
||||
msr.fcr = (1 << 8) | (1 << 9) | (1 << 12) | (1 << 16) | (1 << 19) | (1 << 21);
|
||||
cpu_CR4_mask = CR4_VME | CR4_PVI | CR4_TSD | CR4_DE | CR4_PSE | CR4_MCE;
|
||||
#ifdef USE_DYNAREC
|
||||
codegen_timing_set(&codegen_timing_k6);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case CPU_PENTIUMPRO:
|
||||
|
||||
@@ -99,7 +99,7 @@ static int opSAHF(uint32_t fetchdat)
|
||||
CLOCK_CYCLES(3);
|
||||
PREFETCH_RUN(3, 1, -1, 0,0,0,0, 0);
|
||||
|
||||
#ifdef USE_NEW_DYNAREC
|
||||
#if (defined(USE_DYNAREC) && defined(USE_NEW_DYNAREC))
|
||||
codegen_flags_changed = 0;
|
||||
#endif
|
||||
|
||||
@@ -182,7 +182,7 @@ static int opPOPF_286(uint32_t fetchdat)
|
||||
CLOCK_CYCLES(5);
|
||||
PREFETCH_RUN(5, 1, -1, 1,0,0,0, 0);
|
||||
|
||||
#ifdef USE_NEW_DYNAREC
|
||||
#if (defined(USE_DYNAREC) && defined(USE_NEW_DYNAREC))
|
||||
codegen_flags_changed = 0;
|
||||
#endif
|
||||
|
||||
@@ -242,7 +242,7 @@ static int opPOPF(uint32_t fetchdat)
|
||||
CLOCK_CYCLES(5);
|
||||
PREFETCH_RUN(5, 1, -1, 1,0,0,0, 0);
|
||||
|
||||
#ifdef USE_NEW_DYNAREC
|
||||
#if (defined(USE_DYNAREC) && defined(USE_NEW_DYNAREC))
|
||||
codegen_flags_changed = 0;
|
||||
#endif
|
||||
|
||||
@@ -276,7 +276,7 @@ static int opPOPFD(uint32_t fetchdat)
|
||||
CLOCK_CYCLES(5);
|
||||
PREFETCH_RUN(5, 1, -1, 0,1,0,0, 0);
|
||||
|
||||
#ifdef USE_NEW_DYNAREC
|
||||
#if (defined(USE_DYNAREC) && defined(USE_NEW_DYNAREC))
|
||||
codegen_flags_changed = 0;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -14,8 +14,10 @@ static int opRDTSC(uint32_t fetchdat)
|
||||
EAX = tsc & 0xffffffff;
|
||||
EDX = tsc >> 32;
|
||||
CLOCK_CYCLES(1);
|
||||
#ifdef USE_DYNAREC
|
||||
if (cpu_use_dynarec)
|
||||
update_tsc();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user