6 #include <asm/xenomai/atomic.h>
8 typedef struct xnseqcount {
12 #define XNSEQCNT_ZERO { 0 }
13 #define xnseqcount_init(x) do { *(x) = (xnseqcount_t) XNSEQCNT_ZERO; } while (0)
16 static inline unsigned xnread_seqcount_begin(
const xnseqcount_t *s)
22 xnarch_read_memory_barrier();
23 if (unlikely(ret & 1)) {
33 static inline int xnread_seqcount_retry(
const xnseqcount_t *s,
unsigned start)
35 xnarch_read_memory_barrier();
37 return s->sequence != start;
45 static inline void xnwrite_seqcount_begin(xnseqcount_t *s)
48 xnarch_write_memory_barrier();
51 static inline void xnwrite_seqcount_end(xnseqcount_t *s)
53 xnarch_write_memory_barrier();