From d5114bdf67dc7a58173b767ef007343d21145e2e Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 15 May 2020 07:26:31 +0200 Subject: [PATCH] Fix to the previous commit to only do it when using the recompiler. --- src/acpi.c | 6 ++++-- src/cpu_common/x86_ops_msr.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/acpi.c b/src/acpi.c index a74e14af2..a1eb5f260 100644 --- a/src/acpi.c +++ b/src/acpi.c @@ -125,7 +125,8 @@ acpi_reg_read_intel(int size, uint16_t addr, void *p) case 0x08: case 0x09: case 0x0a: case 0x0b: /* PMTMR - Power Management Timer Register (IO) */ ret = (dev->regs.timer_val >> shift32) & 0xff; - update_tsc(); + if (cpu_use_dynarec) + update_tsc(); break; case 0x0c: case 0x0d: /* GPSTS - General Purpose Status Register (IO) */ @@ -212,7 +213,8 @@ acpi_reg_read_via(int size, uint16_t addr, void *p) case 0x08: case 0x09: case 0x0a: case 0x0b: /* PMTMR - Power Management Timer Register (IO) */ ret = (dev->regs.timer_val >> shift32) & 0xff; - update_tsc(); + if (cpu_use_dynarec) + update_tsc(); break; case 0x10: case 0x11: case 0x12: case 0x13: /* PCNTRL - Processor Control Register (IO) */ diff --git a/src/cpu_common/x86_ops_msr.h b/src/cpu_common/x86_ops_msr.h index e5118a692..4c9fd9fe5 100644 --- a/src/cpu_common/x86_ops_msr.h +++ b/src/cpu_common/x86_ops_msr.h @@ -14,7 +14,8 @@ static int opRDTSC(uint32_t fetchdat) EAX = tsc & 0xffffffff; EDX = tsc >> 32; CLOCK_CYCLES(1); - update_tsc(); + if (cpu_use_dynarec) + update_tsc(); return 0; }