Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

RTIO Multiple Producer Single Consumer (MPSC) Queue API. More...

Files

file  rtio_mpsc.h
 A wait-free intrusive multi producer single consumer (MPSC) queue using a singly linked list.
 

Data Structures

struct  rtio_mpsc_node
 Queue member. More...
 
struct  rtio_mpsc
 MPSC Queue. More...
 

Macros

#define mpsc_ptr_get(ptr)   atomic_ptr_get(&(ptr))
 
#define mpsc_ptr_set(ptr, val)   atomic_ptr_set(&(ptr), val)
 
#define mpsc_ptr_set_get(ptr, val)   atomic_ptr_set(&(ptr), val)
 
#define RTIO_MPSC_INIT(symbol)
 Static initializer for a mpsc queue.
 

Typedefs

typedef atomic_ptr_t mpsc_ptr_t
 

Functions

static void rtio_mpsc_init (struct rtio_mpsc *q)
 Initialize queue.
 
static ALWAYS_INLINE void rtio_mpsc_push (struct rtio_mpsc *q, struct rtio_mpsc_node *n)
 Push a node.
 
static struct rtio_mpsc_nodertio_mpsc_pop (struct rtio_mpsc *q)
 Pop a node off of the list.
 

Detailed Description

RTIO Multiple Producer Single Consumer (MPSC) Queue API.

Macro Definition Documentation

◆ mpsc_ptr_get

#define mpsc_ptr_get (   ptr)    atomic_ptr_get(&(ptr))

◆ mpsc_ptr_set

#define mpsc_ptr_set (   ptr,
  val 
)    atomic_ptr_set(&(ptr), val)

◆ mpsc_ptr_set_get

#define mpsc_ptr_set_get (   ptr,
  val 
)    atomic_ptr_set(&(ptr), val)

◆ RTIO_MPSC_INIT

#define RTIO_MPSC_INIT (   symbol)

#include <zephyr/rtio/rtio_mpsc.h>

Value:
{ \
.head = (struct rtio_mpsc_node *)&symbol.stub, \
.tail = (struct rtio_mpsc_node *)&symbol.stub, \
.stub = { \
.next = NULL, \
}, \
}
Queue member.
Definition: rtio_mpsc.h:80

Static initializer for a mpsc queue.

Since the queue is

Parameters
symbolname of the queue

Typedef Documentation

◆ mpsc_ptr_t

Function Documentation

◆ rtio_mpsc_init()

static void rtio_mpsc_init ( struct rtio_mpsc q)
inlinestatic

#include <zephyr/rtio/rtio_mpsc.h>

Initialize queue.

Parameters
qQueue to initialize or reset

◆ rtio_mpsc_pop()

static struct rtio_mpsc_node * rtio_mpsc_pop ( struct rtio_mpsc q)
inlinestatic

#include <zephyr/rtio/rtio_mpsc.h>

Pop a node off of the list.

Return values
NULLWhen no node is available
nodeWhen node is available

◆ rtio_mpsc_push()

static ALWAYS_INLINE void rtio_mpsc_push ( struct rtio_mpsc q,
struct rtio_mpsc_node n 
)
static

#include <zephyr/rtio/rtio_mpsc.h>

Push a node.

Parameters
qQueue to push the node to
nNode to push into the queue