This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM2634: Issue when interrupt comes during system call and before VIM_IRQPRIMSK is set

Part Number: AM2634

I implement OS and in which I implement for users an AUTOSAR API which is SuspendAllInterrupts().

its job is to suspend all interrupts in the system 

The sequence in our code as follows:

SuspendAllInterrupts()
{

invoke systemcall

}

systemcall_handler:
Do stuff 
Set VIM_IRQPRIMSK with all interrupts disabled 
Do stuff 
return from systemcall 


But if an interrupt comes during system call but before setting VIM_IRQPRIMSK it becomes pending and right after returning form the systemcall it get serviced although the  VIM_IRQPRIMSK was set to disable all interrupts so this broke my function (SuspendAllInterrupts is called but an interrupt get serviced after it) 

Expectation: after return from systemcall the interrupt should not be handled as VIM_IRQPRIMSK is disabling all interrupts.

Please reply ASAP as this is a very critical issue.

Also appreciating if and experienced engineer check this ticket.