Privileged OS instruction trap

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User19909
Level 3
Level 3
First like received
Hello,

I have an issue where a QM application is calling suspend all interrupts, in the call tree in this function OS_hal_mtcr is called and MTCR instruction invokes the trap. but I think this kind of a trivial case when a QM application will call suspend interrupts, so any idea how to solve this situation?
0 Likes
1 Reply
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
It's rather unusual for a QM application to suspend interrupts, because that can obviously disrupt any interrupts that ASIL software components depend on. But of course, it's up to you to define your software architecture.

I'm unclear what the issue is though. OS_hal_mtcr is probably using SYSCALL to elevate the CPU privilege level so that it can execute the DISABLE instruction. QM components generally execute at the lowest privilege level, User-0. That privilege level can't enable or disable interrupts, so SYSCALL trap temporarily boosts the privilege level to Supervisor.
0 Likes