mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 14:58:13 +08:00
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 <chenrun1@xiaomi.com> Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
@@ -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 */
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user