I hadn't looked at the v7M documentation. Looking at the v7M Arm ARM,
the text doesn't mention the exception-entry case, but the pseudocode
ExceptionTaken() function unconditionally calls SetEventRegister().
So I think this is likely a case where the manual text was wrong and
it got corrected for v8M, rather than being a divergence in behaviour.
For QEMU we should set the event register in both these cases
regardless of M-profile version.
Hi Peter,
Thanks for clarifying this I will take this into account for v2.
v7M's text is also a bit confused about whether the SEVONPEND
bit affects only interrupts, or all exceptions. v8M seems to
consistently say "interrupts". I guess we go with "assume this
was a mistake in the v7M text". If you happen to have convenient
access to real hardware we could test the actual behaviour, but
if not I would go with "only interrupts" for both v7M and v8M.
Currently I don't have access to hardware, so I will take "only interrupts"
into consideration.
In future if I do get access to real hardware I will test this separately.
Ah, I see -- currently the wfe helper calls the yield helper,
and that always calls cpu_loop_exit(), so the helper never
returns. (I'd assumed that because WFE is conceptually a NOP
for us at the moment that the helper would return.)
We should add a comment similar to the one we have for the
DISAS_WFI case:
/* Go back to the main loop to check for interrupts */
Sure will take care of this in v2.
Thanks,
Ashish