OSDN Git Service

target-xtensa: avoid duplicate timer interrupt delivery
authorMax Filippov <jcmvbkbc@gmail.com>
Thu, 25 Sep 2014 12:12:31 +0000 (16:12 +0400)
committerMax Filippov <jcmvbkbc@gmail.com>
Sun, 2 Nov 2014 21:51:44 +0000 (00:51 +0300)
commitc9e9521fcb840b14ec0ae9117b224ff8a71418da
tree74a60acef2ad9cf1a62ee8bb5122036d3e78f8a7
parent20303e42d4726018ee64798b4d3051cbe6eea9f8
target-xtensa: avoid duplicate timer interrupt delivery

Timer interrupt should be raised at the same cycle when CCOUNT equals
CCOMPARE. As cycles are counted in batches, timer interrupt is sent
every time CCOMPARE lies in the interval [old CCOUNT, new CCOUNT]. This
is wrong, because when new CCOUNT equals CCOMPARE interrupt is sent
twice, once for the upper interval boundary and once for the lower. Fix
that by excluding lower interval boundary from the condition.

This doesn't have user-visible effect, because CCOMPARE reload always
causes CCOUNT increment followed by current timer interrupt reset.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
hw/xtensa/pic_cpu.c