This is an automated email from the ASF dual-hosted git repository. lupyuen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 960bd97bb00bba592172603382d92607d15a0dc2 Author: Bowen Wang <[email protected]> AuthorDate: Wed Mar 5 20:22:09 2025 +0800 drivers/rpmsg: use NuttX atomic_t API instead of C11 atomics Replace C11 atomic types and operations with NuttX native atomic interfaces (atomic_t, atomic_set, atomic_fetch_and_acquire, atomic_fetch_or_acquire) to avoid build failures on toolchains that lack full C11 atomics support. Signed-off-by: chenrun1 <[email protected]> Signed-off-by: Bowen Wang <[email protected]> --- drivers/rpmsg/rpmsg.c | 6 +++--- include/nuttx/rpmsg/rpmsg.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/rpmsg/rpmsg.c b/drivers/rpmsg/rpmsg.c index c25e29c8712..b2f19b123af 100644 --- a/drivers/rpmsg/rpmsg.c +++ b/drivers/rpmsg/rpmsg.c @@ -531,7 +531,7 @@ int rpmsg_register(FAR const char *path, FAR struct rpmsg_s *rpmsg, metal_list_init(&rpmsg->bind); nxrmutex_init(&rpmsg->lock); rpmsg->ops = ops; - atomic_store(&rpmsg->signals, RPMSG_SIGNAL_RUNNING); + atomic_set(&rpmsg->signals, RPMSG_SIGNAL_RUNNING); /* Add priv to list */ @@ -605,8 +605,8 @@ void rpmsg_modify_signals(FAR struct rpmsg_s *rpmsg, FAR struct metal_list *node; bool needlock; - atomic_fetch_and(&rpmsg->signals, ~clrflags); - atomic_fetch_or(&rpmsg->signals, setflags); + atomic_fetch_and_acquire(&rpmsg->signals, ~clrflags); + atomic_fetch_or_acquire(&rpmsg->signals, setflags); /* Send signal to Router Hub */ diff --git a/include/nuttx/rpmsg/rpmsg.h b/include/nuttx/rpmsg/rpmsg.h index e4f19cc88dd..36b6daebc12 100644 --- a/include/nuttx/rpmsg/rpmsg.h +++ b/include/nuttx/rpmsg/rpmsg.h @@ -67,7 +67,7 @@ struct rpmsg_s #ifdef CONFIG_RPMSG_TEST struct rpmsg_endpoint test; #endif - atomic_int signals; + atomic_t signals; }; struct rpmsg_timestamp_s
