xiaoxiang781216 commented on pull request #5782:
URL: https://github.com/apache/incubator-nuttx/pull/5782#issuecomment-1079691471


   > > Why not directly handle timer interrupt in S-mode?
   > 
   > The memory mapped registers are available in M-mode only.
   > 
   > > > * For some reason clearing the interrupt does not work from S-mode, so
   > > >   created a call gate to clear the interrupt in M-mode
   > > 
   > > 
   > > Could we find the root cause?
   > 
   > I tried to simply clear the interrupt from S-mode but nothing happens. 
Writing e.g. CLEAR_CSR(sip, SIP_STIP); leaves the interrupt asserted 
unfortunately. Clearing from M-mode works. I can only assume this is by design, 
even though it is a bit silly IMO.
   
   @pussuw from the spec, S-mode can't change STIP:
   ```
   its sip.STIP and sie.STIE are the interrupt-pending and interrupt-enable 
bits for supervisorlevel timer interrupts. If implemented, STIP is read-only 
in sip, and is set and cleared by the
   execution environment.
   ```


-- 
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