summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortychon <tychon@FreeBSD.org>2014-02-21 01:15:26 +0000
committertychon <tychon@FreeBSD.org>2014-02-21 01:15:26 +0000
commit19c633f86f900748acb7cb8836a83f49c5a92fb5 (patch)
treee47fb323b7a66a0b1eb09f338b24d121a8a384dd
parent8e2617b93fdb895221089a879ee8045802daa901 (diff)
downloadFreeBSD-src-19c633f86f900748acb7cb8836a83f49c5a92fb5.zip
FreeBSD-src-19c633f86f900748acb7cb8836a83f49c5a92fb5.tar.gz
Avoid clobbering the counter mode when issuing a latch command.
Approved by: grehan (co-mentor)
-rw-r--r--usr.sbin/bhyve/pit_8254.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/bhyve/pit_8254.c b/usr.sbin/bhyve/pit_8254.c
index 3eb1aa7..26fb03d 100644
--- a/usr.sbin/bhyve/pit_8254.c
+++ b/usr.sbin/bhyve/pit_8254.c
@@ -216,11 +216,12 @@ pit_8254_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
c = &counter[sel >> 6];
c->ctx = ctx;
- c->mode = mode;
if (rw == TIMER_LATCH)
pit_update_counter(c, 1);
- else
+ else {
+ c->mode = mode;
c->olbyte = 0; /* reset latch after reprogramming */
+ }
return (0);
}
OpenPOWER on IntegriCloud