From 0cbe6ae918527ceaf6875278e2bb15efba02c457 Mon Sep 17 00:00:00 2001 From: SarahW Date: Thu, 19 Nov 2020 22:17:05 +0000 Subject: [PATCH] Ensure that any cycles spent when entering IRQ/NMI in interpreter are accounted for in the TSC, and by extension the timer system. --- src/386.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/386.c b/src/386.c index 6ef54b6..fc9cb3b 100644 --- a/src/386.c +++ b/src/386.c @@ -214,10 +214,6 @@ void exec386(int cycs) } } } - ins_cycles -= cycles; - tsc += ins_cycles; - - cycdiff=oldcyc-cycles; if (cpu_state.smi_pending) { @@ -291,6 +287,11 @@ void exec386(int cycs) ins++; insc++; + ins_cycles -= cycles; + tsc += ins_cycles; + + cycdiff=oldcyc-cycles; + if (timetolive) { timetolive--;