Closed iankuan closed 7 years ago
Sorry about the third point which I mention. I misunderstand this situation. In that case, the claim is correct above but not in this case. We only use svc
and we can control when it would happen, so we don't have to worry about ipsr
.
Let's take
04-Multitasking
for example. I provide three doubts on exception return.First, Is it correctly to use assembly instruction
control
to replace exception return? In my opinion,control
is only used when we want to change the state from privileged thread mode to unprivileged thread mode. We would change the state from handler mode to unprivileged mode when first task is created.Second, I can not figure it out why we need to change the state from handler mode to unprivileged thread mode before we exception return. We can just launch exception return directly.
Third, I think it is not enough to deal with the register, "psr" by
msr psr_nzcvq, ip
. If the interrupt occurred when we are in IT block, It would enable the flag in "ipsr". But we could not restore the state bymrs
because of the specification. However, to my best of my knowledge, It can only be restored completely by exception return.By the way, I'm working on these problem. I would send the PR recently.