From fabf4a5142d09a47f0b8d47b37df45a386914a9d Mon Sep 17 00:00:00 2001 From: hujun5 Date: Tue, 7 Jan 2025 22:01:08 +0800 Subject: [PATCH] fix compile error Error: /github/workspace/sources/nuttx/include/nuttx/spinlock_type.h:57:3: error: unknown type name 'atomic_t' 368 57 | atomic_t owner; 369 | ^~~~~~~~ 370Error: /github/workspace/sources/nuttx/include/nuttx/spinlock_type.h:58:3: error: unknown type name 'atomic_t' 371 58 | atomic_t next; 372 | ^~~~~~~~ Signed-off-by: hujun5 --- drivers/timers/rpmsg_rtc.c | 1 + include/nuttx/spinlock_type.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/drivers/timers/rpmsg_rtc.c b/drivers/timers/rpmsg_rtc.c index 68a5c731c5f..b3b12188b68 100644 --- a/drivers/timers/rpmsg_rtc.c +++ b/drivers/timers/rpmsg_rtc.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include diff --git a/include/nuttx/spinlock_type.h b/include/nuttx/spinlock_type.h index db3b64f00ee..e50c9254c7c 100644 --- a/include/nuttx/spinlock_type.h +++ b/include/nuttx/spinlock_type.h @@ -29,6 +29,10 @@ #include +#if defined(CONFIG_RW_SPINLOCK) || defined(CONFIG_TICKET_SPINLOCK) +#include +#endif + #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C"