8#ifndef ZEPHYR_SYS_MPSC_LOCKFREE_H_
9#define ZEPHYR_SYS_MPSC_LOCKFREE_H_
53#if defined(CONFIG_SMP)
57#define mpsc_ptr_get(ptr) atomic_ptr_get(&(ptr))
58#define mpsc_ptr_set(ptr, val) atomic_ptr_set(&(ptr), val)
59#define mpsc_ptr_set_get(ptr, val) atomic_ptr_set(&(ptr), val)
65#define mpsc_ptr_get(ptr) ptr
66#define mpsc_ptr_set(ptr, val) ptr = val
67#define mpsc_ptr_set_get(ptr, val) \
69 mpsc_ptr_t tmp = ptr; \
99#define MPSC_INIT(symbol) \
101 .head = (struct mpsc_node *)&symbol.stub, \
102 .tail = (struct mpsc_node *)&symbol.stub, \
152 if (tail == &q->
stub) {
static ALWAYS_INLINE unsigned int arch_irq_lock(void)
Disable all interrupts on the local CPU.
Definition irq.h:168
static ALWAYS_INLINE void arch_irq_unlock(unsigned int key)
Definition irq.h:176
void * atomic_ptr_t
Definition atomic_types.h:17
#define ALWAYS_INLINE
Definition common.h:129
atomic_ptr_t mpsc_ptr_t
Definition mpsc_lockfree.h:55
static ALWAYS_INLINE void mpsc_push(struct mpsc *q, struct mpsc_node *n)
Push a node.
Definition mpsc_lockfree.h:126
static struct mpsc_node * mpsc_pop(struct mpsc *q)
Pop a node off of the list.
Definition mpsc_lockfree.h:145
#define mpsc_ptr_set(ptr, val)
Definition mpsc_lockfree.h:58
#define mpsc_ptr_get(ptr)
Definition mpsc_lockfree.h:57
#define mpsc_ptr_set_get(ptr, val)
Definition mpsc_lockfree.h:59
static void mpsc_init(struct mpsc *q)
Initialize queue.
Definition mpsc_lockfree.h:113
Queue member.
Definition mpsc_lockfree.h:79
mpsc_ptr_t next
Definition mpsc_lockfree.h:80
MPSC Queue.
Definition mpsc_lockfree.h:86
struct mpsc_node stub
Definition mpsc_lockfree.h:89
mpsc_ptr_t head
Definition mpsc_lockfree.h:87
struct mpsc_node * tail
Definition mpsc_lockfree.h:88