You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "inochisa (via GitHub)" <gi...@apache.org> on 2024/04/10 04:09:02 UTC

[PR] arch/riscv: force using encoding macro for CSR access [nuttx]

inochisa opened a new pull request, #12117:
URL: https://github.com/apache/nuttx/pull/12117

   Using CSR name depends on compiler support heavily, but CSR encoding does not have this problem. It also make it easy to add new CSR support even if the compiler does not support.
   
   Unify CSR access by using the CSR encoding macro.
   
   ## Summary
   
   ## 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: commits-unsubscribe@nuttx.apache.org

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


Re: [PR] arch/riscv: force using encoding macro for CSR access [nuttx]

Posted by "inochisa (via GitHub)" <gi...@apache.org>.
inochisa commented on PR #12117:
URL: https://github.com/apache/nuttx/pull/12117#issuecomment-2048549568

   > > Using CSR name depends on compiler support heavily, but CSR encoding does not have this problem. It also make it easy to add new CSR support even if the compiler does not support.
   > 
   > @inochisa Thanks for unifying the CSR access, could you give an example of a CSR Name that differs by Compiler? So we can watch out for similar problems in future. I will test your PR on Ox64 BL808 SBC. Thanks!
   
   @lupyuen see [c906_head.S](https://github.com/apache/nuttx/blob/master/arch/risc-v/src/c906/c906_head.S#L64), `mxstatus` is a important CSR for bare programming. But if we don not use the T-HEAD toolchain, it can not be touched, However, it can be accessed directly from the CSR id. (This patch does not include this change, as it need to write a T-HEAD CSR mapping like [this](https://github.com/riscv-software-src/opensbi/blob/master/platform/generic/include/thead/c9xx_encoding.h), I will prepare this patch once this get accepted).
   
   Another scenario is for AIA  (This is what I am working now), which need at least gcc version 12 IIRC. This may cause problem when using old gccs.


-- 
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-unsubscribe@nuttx.apache.org

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


Re: [PR] arch/riscv: force using encoding macro for CSR access [nuttx]

Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #12117:
URL: https://github.com/apache/nuttx/pull/12117#issuecomment-2047774304

   > Using CSR name depends on compiler support heavily, but CSR encoding does not have this problem. It also make it easy to add new CSR support even if the compiler does not support.
   
   @inochisa Thanks for unifying the CSR access, could you give an example of a CSR Name that differs by Compiler? So we can watch out for similar problems in future. I will test your PR on Ox64 BL808 SBC. Thanks!


-- 
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-unsubscribe@nuttx.apache.org

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


Re: [PR] arch/riscv: force using encoding macro for CSR access [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #12117:
URL: https://github.com/apache/nuttx/pull/12117


-- 
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-unsubscribe@nuttx.apache.org

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


Re: [PR] arch/riscv: force using encoding macro for CSR access [nuttx]

Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #12117:
URL: https://github.com/apache/nuttx/pull/12117#issuecomment-2048553027

   That's an excellent example. Thanks! 


-- 
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-unsubscribe@nuttx.apache.org

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