]> git.proxmox.com Git - mirror_qemu.git/commit
target/xtensa: refactor CCOUNT/CCOMPARE
authorMax Filippov <jcmvbkbc@gmail.com>
Wed, 4 Sep 2013 00:57:49 +0000 (04:57 +0400)
committerMax Filippov <jcmvbkbc@gmail.com>
Sun, 15 Jan 2017 21:01:55 +0000 (13:01 -0800)
commit59a71f75789fb15bac0a67a18325c4ac1acc981c
tree65a7038c5a604017f569f5a4a39af13322cb0c74
parentbd527a83232ce8b48dac4b8c86607ad8a7e28d98
target/xtensa: refactor CCOUNT/CCOMPARE

Xtensa cores may have a register (CCOUNT) that counts core clock cycles.
It may also have a number of registers (CCOMPAREx); when CCOUNT value
passes the value of CCOMPAREx, timer interrupt x is raised.

Currently xtensa target counts a number of completed instructions and
assumes that for CCOUNT one instruction takes one cycle to complete.
It calls helper function to update CCOUNT register at every TB end and
raise timer interrupts. This scheme works very predictably and doesn't
have noticeable performance impact, but it is hard to use with multiple
synchronized processors, especially with coming MTTCG.

Derive CCOUNT from the virtual simulation time, QEMU_CLOCK_VIRTUAL.
Use native QEMU timers for CCOMPARE timers, one timer for each register.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
hw/xtensa/pic_cpu.c
target/xtensa/cpu.h
target/xtensa/helper.h
target/xtensa/op_helper.c
target/xtensa/translate.c