You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "xiaoxiang781216 (via GitHub)" <gi...@apache.org> on 2023/09/16 12:06:18 UTC

[GitHub] [nuttx] xiaoxiang781216 commented on issue #10642: Why nuttx didn't support atomic instruction?

xiaoxiang781216 commented on issue #10642:
URL: https://github.com/apache/nuttx/issues/10642#issuecomment-1722215958

   atomic operation is defined since c11(https://en.cppreference.com/w/c/language/atomic), and the implementation is provided by toolchain already(e.g, libgcc.a from gcc). That's why you can't find the implementation from nuttx, an atmic test was added recently to help you check the atomic support with your toolchain:
   https://github.com/apache/nuttx-apps/tree/master/testing/atomic.
   For the old compiler, nuttx provide a simple implementation which ensure the atomic by disabling interrupt temporarily:
   https://github.com/apache/nuttx/blob/master/libs/libc/machine/arch_atomic.c
   Of cause, this implementation just works with one CPU case.
   
   


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