Avoid clobbering the counter mode when issuing a latch command.

Approved by:	grehan (co-mentor)
This commit is contained in:
Tycho Nightingale 2014-02-21 01:15:26 +00:00
parent 84beb433c0
commit 182d7debb9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=262274

View File

@ -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);
}