From 60375cd1e4507db3103f22017d0897a7294d3629 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Mon, 11 Jun 2001 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2001-06-11 --- pc/i8253.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pc/i8253.c b/pc/i8253.c index 4c38c6fccb21b9a31b3fcf0f8651e752796f310e..805fc75e0dbd3430e7e83c4ea8636afab30da8d9 100644 --- a/pc/i8253.c +++ b/pc/i8253.c @@ -235,6 +235,15 @@ clockintr0(Ureg* ureg, void *v) now = fastticks(nil); when = i8253.when; + + /* + * If we suspend the machine and resume, the + * processor cycle counter gets reset. Detect this + * and deal with it. + */ + if(now < i8253.when && i8253.when-now > 3*i8253.fastperiod) + i8253.when = now; + if(now >= i8253.when){ clockintr(ureg, v); do