diff --git a/sys/arm/include/atomic-v4.h b/sys/arm/include/atomic-v4.h index 7048178f3046..2854655a732e 100644 --- a/sys/arm/include/atomic-v4.h +++ b/sys/arm/include/atomic-v4.h @@ -439,4 +439,37 @@ atomic_subtract_long(volatile u_long *p, u_long v) atomic_subtract_32((volatile uint32_t *)p, v); } +/* + * ARMv5 does not support SMP. For both kernel and user modes, only a + * compiler barrier is needed for fences, since CPU is always + * self-consistent. + */ +static __inline void +atomic_thread_fence_acq(void) +{ + + __compiler_membar(); +} + +static __inline void +atomic_thread_fence_rel(void) +{ + + __compiler_membar(); +} + +static __inline void +atomic_thread_fence_acq_rel(void) +{ + + __compiler_membar(); +} + +static __inline void +atomic_thread_fence_seq_cst(void) +{ + + __compiler_membar(); +} + #endif /* _MACHINE_ATOMIC_H_ */ diff --git a/sys/arm/include/atomic-v6.h b/sys/arm/include/atomic-v6.h index 06d8880192c7..d22f7e169e29 100644 --- a/sys/arm/include/atomic-v6.h +++ b/sys/arm/include/atomic-v6.h @@ -596,4 +596,32 @@ atomic_store_rel_long(volatile u_long *p, u_long v) #undef ATOMIC_ACQ_REL #undef ATOMIC_ACQ_REL_LONG +static __inline void +atomic_thread_fence_acq(void) +{ + + dmb(); +} + +static __inline void +atomic_thread_fence_rel(void) +{ + + dmb(); +} + +static __inline void +atomic_thread_fence_acq_rel(void) +{ + + dmb(); +} + +static __inline void +atomic_thread_fence_seq_cst(void) +{ + + dmb(); +} + #endif /* _MACHINE_ATOMIC_V6_H_ */ diff --git a/sys/arm/include/atomic.h b/sys/arm/include/atomic.h index 5379030e499f..039af34d77a3 100644 --- a/sys/arm/include/atomic.h +++ b/sys/arm/include/atomic.h @@ -82,34 +82,6 @@ atomic_store_long(volatile u_long *dst, u_long src) *dst = src; } -static __inline void -atomic_thread_fence_acq(void) -{ - - dmb(); -} - -static __inline void -atomic_thread_fence_rel(void) -{ - - dmb(); -} - -static __inline void -atomic_thread_fence_acq_rel(void) -{ - - dmb(); -} - -static __inline void -atomic_thread_fence_seq_cst(void) -{ - - dmb(); -} - #define atomic_clear_ptr atomic_clear_32 #define atomic_set_ptr atomic_set_32 #define atomic_cmpset_ptr atomic_cmpset_32