sdc-g commented on PR #15985:
URL: https://github.com/apache/nuttx/pull/15985#issuecomment-2735462706

   Hi @chirping78 
   
   Sorry, one more discussion: while level-2 and above interrupt, PS.EXCM also 
set to 1.
   
   So if context switching happens, there is also double exception if window 
ratation instruction is executed.
   The sequence like: threadA PS.EXCM is 0 -> PS.EXCM set to 1 while level-2 
interrupt -> context switching to threadB -> level-2 interrupt and resume 
threadA with PS.EXCM=1, then double exception
   
   Please refer to "xtensa Instruction Set Architecture (ISA) Reference Manual"
   ```
   The taking of an exception under the Exception Option has the following 
semantics:
   procedure Exception(cause)
   if (PS.EXCM & NDEPC=1) then
   DEPC ← PC
   nextPC ← DoubleExceptionVector
   elseif PS.EXCM then
   EPC[1] ← PC
   nextPC ← DoubleExceptionVector
   elseif PS.UM then
   EPC[1] ← PC
   nextPC ← UserExceptionVector
   else
   EPC[1] ← PC
   nextPC ← KernelExceptionVector
   endif
   EXCCAUSE ← cause
   PS.EXCM ← 1
   endprocedure Exception
   ```
   
   Is it possible and correct understanding?


-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to