mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] include: asm-generic/atomic.h: always define atomic/atomic_64
@ 2023-09-21  9:43 Ahmad Fatoum
  2023-09-21  9:43 ` [PATCH 2/2] include: add linux/atomic.h header Ahmad Fatoum
  2023-09-21 12:11 ` [PATCH 1/2] include: asm-generic/atomic.h: always define atomic/atomic_64 Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2023-09-21  9:43 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

64-bit accesses are always atomic in barebox, because we have nothing
that would interrupt them. Thus define them unconditionally in the
asm-generic header. This shows that an include for the s64 time is
missing, so add that as well.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/asm-generic/atomic.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h
index 45fc5da57594..27b0f73b487b 100644
--- a/include/asm-generic/atomic.h
+++ b/include/asm-generic/atomic.h
@@ -8,12 +8,13 @@
 #ifndef __ASM_GENERIC_ATOMIC_H
 #define __ASM_GENERIC_ATOMIC_H
 
+#include <linux/types.h>
+
 #ifdef CONFIG_SMP
 #error SMP not supported
 #endif
 #define ATOMIC_INIT(i)	{ (i) }
 
-#ifdef CONFIG_64BIT
 typedef struct { s64 counter; } atomic64_t;
 
 #define atomic64_read(v)	((v)->counter)
@@ -59,7 +60,7 @@ static inline int atomic64_add_negative(s64 i, volatile atomic64_t *v)
 	return val < 0;
 }
 
-#else
+
 typedef struct { volatile int counter; } atomic_t;
 
 #define ATOMIC_INIT(i)	{ (i) }
@@ -114,7 +115,6 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
 {
 	*addr &= ~mask;
 }
-#endif
 
 /* Atomic operations are already serializing on ARM */
 #define smp_mb__before_atomic_dec()	barrier()
-- 
2.39.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-21 12:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-21  9:43 [PATCH 1/2] include: asm-generic/atomic.h: always define atomic/atomic_64 Ahmad Fatoum
2023-09-21  9:43 ` [PATCH 2/2] include: add linux/atomic.h header Ahmad Fatoum
2023-09-21 12:11 ` [PATCH 1/2] include: asm-generic/atomic.h: always define atomic/atomic_64 Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox