On 4/21/22 02:15, yangxiaojuan wrote:

On 2022/4/20 上午1:05, Richard Henderson wrote:
You'd use a store, just like you were already doing in trans_csrwr.

But here's how I'd improve this.  For avoidance of doubt, all of this would go in trans_priviledged.c.inc -- there's no use of csr_offsets[] outside of that file.

Thanks you very much,  I had tested this with bios,  it worked well, and I have two questions.

1. CSRFL_IO,   how to use it.   I don't understand  CPUState options 
'can_do_Io',

Whenever a cpu touches a device, like a timer or clock, must have io flag set. Missing this flag should result in assertion failures when running with -icount.

2./* fall through */,   this may have warning,  should we care about this?

It should not have a warning, as the comment itself should suppress that. For more complex cases we also have QEMU_FALLTHROUGH.


r~

Reply via email to