diff options
author | jasper <jasper@openbsd.org> | 2019-05-27 19:21:43 +0000 |
---|---|---|
committer | jasper <jasper@openbsd.org> | 2019-05-27 19:21:43 +0000 |
commit | a50a4aa689c69a2e52fe32a51184244b7d119c2a (patch) | |
tree | 9516ce51354997e890f1e15a569b465ca1cd2a13 /usr.sbin/vmd | |
parent | Clarify newlines inside {} a little. (diff) | |
download | wireguard-openbsd-a50a4aa689c69a2e52fe32a51184244b7d119c2a.tar.xz wireguard-openbsd-a50a4aa689c69a2e52fe32a51184244b7d119c2a.zip |
only reschedule the periodic interrupt after updating register A
if something changed in register A.
when updating register A we were checking in register B if the
PIE bit was set in order to decide if rtc_reschedule_per needed
to be called. if that bit was changed then the timer rate would
already have been adjusted by rtc_update_regb so the call from
rtc_update_rega is not needed.
this now matches what qemu and other emulators are doing too.
ok mlarkin@
Diffstat (limited to 'usr.sbin/vmd')
-rw-r--r-- | usr.sbin/vmd/mc146818.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/vmd/mc146818.c b/usr.sbin/vmd/mc146818.c index 014232c7aab..e4a2b84f41c 100644 --- a/usr.sbin/vmd/mc146818.c +++ b/usr.sbin/vmd/mc146818.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mc146818.c,v 1.18 2018/07/12 10:15:44 mlarkin Exp $ */ +/* $OpenBSD: mc146818.c,v 1.19 2019/05/27 19:21:43 jasper Exp $ */ /* * Copyright (c) 2016 Mike Larkin <mlarkin@openbsd.org> * @@ -216,7 +216,7 @@ rtc_update_rega(uint32_t data) __func__); rtc.regs[MC_REGA] = data; - if (rtc.regs[MC_REGB] & MC_REGB_PIE) + if ((rtc.regs[MC_REGA] ^ data) & 0x0f) rtc_reschedule_per(); } |