zhuyanlinzyl opened a new pull request #5261:
URL: https://github.com/apache/incubator-nuttx/pull/5261


   ## Summary
   
   Add svccall handler and use svc call in context switch.
   
   # Reason why now context switch probability not work
   
   In some hardware Xtensa configurations, such as we used now, all timers have 
higher interrupt level than level 1.
   
   This is not the wrong case, but when timer interrupt happen,
   **the EXCM bit was not set by hardware in higher level**!!!
   
   1)  When in timer interrupt, if a context switch happen, the current 
interrupted context will 
         save by xtensa_savestate(rtcb->xcp.regs),  with **EXCM bit not set**
   
   2)   When this task become ready to run again, if it restore context from 
xtensa_context_restore.
         but with ps' EXCM bit not set. 
         after  ` wsr             a2, PS` instruction, the interrupt enable 
again...
         If interrupt happens at that time,  the context was corrupted。
             
   
   # Reason for use sw-interrupt as syscall interrupt
   
   The xtensa `syscall` instruction can cause SYSCALL interrupt. 
   **But** syscall interrupt is same interrupt level with level-one interrupt. 
It is design by hardware.
   Nuttx svcall must support when `enter_critical_section` ,  but can generate 
svcall interrupt.
   
   
   # Another way
   As we must find another way, we use software interrupt as svcall because: 
   Software interrupt may have a higher level than level-1 interrupt, this is 
design by hardware configuration.
   
   
   ## Impact
   
   
   ## Testing
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to