This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Trapping IRQ from Secure World Firmware to Normal World Rich OS over Monitor Vector Table

I am trapping IRQs that are prompted in Secure World to a Rich OS in Non Secure World over the Monitor IRQ-Handler. The Rich OS should not notice that the Interrupt was catched by the Monitor, therefore the Monitor IRQ-Handler branches, after storing and loading registers, directly to the IRQ section of the Normal World`s interrupt vector table. After executing the Normal World IRQ-Handler I want to resume in Normal World where it stopped execution at the last World switch. Therefore I am saving the respective address in the link register when switching to the Normal World IRQ-Handler. The switching is done via "MOVS pc, lr" since I need to switch from Monitor-Mode to IRQ-Mode and execute the branch atomically. However MOVS is updating the link register of the IRQ-Mode which I need to return into normal World Supervisor Mode. With the wrong value in lr I cannot properly return from Normal World IRQ-Handler.

Why is MOVS updating lr? I could not find this behavior in the ARM specs on MOVS.

Did anybody implement something like this before? What instruction could I use instead of MOVS which does not perform an update on the link register? How would you recommend trapping Interrupts to Non Secure World over Monitor whithout the Rich OS in Non Secure World knowing or caring that the Interrupt was originally catched in Monitor IRQ-Handler? Is there any template code describing handling of secure (FIQ) and non-secure (IRQ) interrupts?

Any help is appreciated. Thank you.

Parents Reply Children
No data