ChibiOS 21.11.4
Objects FIFOs

Detailed Description

Collaboration diagram for Objects FIFOs:

Data Structures

struct  ch_objects_fifo
 Type of an objects FIFO. More...

Typedefs

typedef struct ch_objects_fifo objects_fifo_t
 Type of an objects FIFO.

Functions

static void chFifoObjectInitAligned (objects_fifo_t *ofp, size_t objsize, size_t objn, unsigned objalign, void *objbuf, msg_t *msgbuf)
 Initializes a FIFO object.
static void chFifoObjectInit (objects_fifo_t *ofp, size_t objsize, size_t objn, void *objbuf, msg_t *msgbuf)
 Initializes a FIFO object.
static void * chFifoTakeObjectI (objects_fifo_t *ofp)
 Allocates a free object.
static void * chFifoTakeObjectTimeoutS (objects_fifo_t *ofp, sysinterval_t timeout)
 Allocates a free object.
static void * chFifoTakeObjectTimeout (objects_fifo_t *ofp, sysinterval_t timeout)
 Allocates a free object.
static void chFifoReturnObjectI (objects_fifo_t *ofp, void *objp)
 Releases a fetched object.
static void chFifoReturnObjectS (objects_fifo_t *ofp, void *objp)
 Releases a fetched object.
static void chFifoReturnObject (objects_fifo_t *ofp, void *objp)
 Releases a fetched object.
static void chFifoSendObjectI (objects_fifo_t *ofp, void *objp)
 Posts an object.
static void chFifoSendObjectS (objects_fifo_t *ofp, void *objp)
 Posts an object.
static void chFifoSendObject (objects_fifo_t *ofp, void *objp)
 Posts an object.
static void chFifoSendObjectAheadI (objects_fifo_t *ofp, void *objp)
 Posts an high priority object.
static void chFifoSendObjectAheadS (objects_fifo_t *ofp, void *objp)
 Posts an high priority object.
static void chFifoSendObjectAhead (objects_fifo_t *ofp, void *objp)
 Posts an high priority object.
static msg_t chFifoReceiveObjectI (objects_fifo_t *ofp, void **objpp)
 Fetches an object.
static msg_t chFifoReceiveObjectTimeoutS (objects_fifo_t *ofp, void **objpp, sysinterval_t timeout)
 Fetches an object.
static msg_t chFifoReceiveObjectTimeout (objects_fifo_t *ofp, void **objpp, sysinterval_t timeout)
 Fetches an object.

Typedef Documentation

◆ objects_fifo_t

Type of an objects FIFO.

Function Documentation

◆ chFifoObjectInitAligned()

void chFifoObjectInitAligned ( objects_fifo_t * ofp,
size_t objsize,
size_t objn,
unsigned objalign,
void * objbuf,
msg_t * msgbuf )
inlinestatic

Initializes a FIFO object.

Precondition
The messages size must be a multiple of the alignment requirement.
Parameters
[out]ofppointer to a objects_fifo_t structure
[in]objsizeobject size
[in]objnnumber of objects available
[in]objalignrequired objects alignment
[in]objbufpointer to the buffer of objects, it must be able to hold objn objects of objsize size with objalign alignment
[in]msgbufpointer to the buffer of messages, it must be able to hold objn messages
Function Class:
Object or module nitializer function.

Definition at line 128 of file chobjfifos.h.

References chDbgCheck, chGuardedPoolLoadArray(), chGuardedPoolObjectInitAligned(), chMBObjectInit(), ch_objects_fifo::free, and ch_objects_fifo::mbx.

Referenced by chFactoryCreateObjectsFIFO(), and chFifoObjectInit().

Here is the call graph for this function:

◆ chFifoObjectInit()

void chFifoObjectInit ( objects_fifo_t * ofp,
size_t objsize,
size_t objn,
void * objbuf,
msg_t * msgbuf )
inlinestatic

Initializes a FIFO object.

Precondition
The messages size must be a multiple of the alignment requirement.
Parameters
[out]ofppointer to a objects_fifo_t structure
[in]objsizeobject size
[in]objnnumber of objects available
[in]objbufpointer to the buffer of objects, it must be able to hold objn objects of objsize size
[in]msgbufpointer to the buffer of messages, it must be able to hold objn messages
Function Class:
Object or module nitializer function.

Definition at line 154 of file chobjfifos.h.

References chFifoObjectInitAligned(), and PORT_NATURAL_ALIGN.

Here is the call graph for this function:

◆ chFifoTakeObjectI()

void * chFifoTakeObjectI ( objects_fifo_t * ofp)
inlinestatic

Allocates a free object.

Parameters
[in]ofppointer to a objects_fifo_t structure
Returns
The pointer to the allocated object.
Return values
NULLif an object is not immediately available.
Function Class:
This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.

Definition at line 172 of file chobjfifos.h.

References chGuardedPoolAllocI(), and ch_objects_fifo::free.

Here is the call graph for this function:

◆ chFifoTakeObjectTimeoutS()

void * chFifoTakeObjectTimeoutS ( objects_fifo_t * ofp,
sysinterval_t timeout )
inlinestatic

Allocates a free object.

Parameters
[in]ofppointer to a objects_fifo_t structure
[in]timeoutthe number of ticks before the operation timeouts, the following special values are allowed:
  • TIME_IMMEDIATE immediate timeout.
  • TIME_INFINITE no timeout.
Returns
The pointer to the allocated object.
Return values
NULLif an object is not available within the specified timeout.
Function Class:
This is an S-Class API, this function can be invoked from within a system lock zone by threads only.

Definition at line 192 of file chobjfifos.h.

References chGuardedPoolAllocTimeoutS(), and ch_objects_fifo::free.

Here is the call graph for this function:

◆ chFifoTakeObjectTimeout()

void * chFifoTakeObjectTimeout ( objects_fifo_t * ofp,
sysinterval_t timeout )
inlinestatic

Allocates a free object.

Parameters
[in]ofppointer to a objects_fifo_t structure
[in]timeoutthe number of ticks before the operation timeouts, the following special values are allowed:
  • TIME_IMMEDIATE immediate timeout.
  • TIME_INFINITE no timeout.
Returns
The pointer to the allocated object.
Return values
NULLif an object is not available within the specified timeout.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 213 of file chobjfifos.h.

References chGuardedPoolAllocTimeout(), and ch_objects_fifo::free.

Here is the call graph for this function:

◆ chFifoReturnObjectI()

void chFifoReturnObjectI ( objects_fifo_t * ofp,
void * objp )
inlinestatic

Releases a fetched object.

Parameters
[in]ofppointer to a objects_fifo_t structure
[in]objppointer to the object to be released
Function Class:
This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.

Definition at line 227 of file chobjfifos.h.

References chGuardedPoolFreeI(), and ch_objects_fifo::free.

Here is the call graph for this function:

◆ chFifoReturnObjectS()

void chFifoReturnObjectS ( objects_fifo_t * ofp,
void * objp )
inlinestatic

Releases a fetched object.

Parameters
[in]ofppointer to a objects_fifo_t structure
[in]objppointer to the object to be released
Function Class:
This is an S-Class API, this function can be invoked from within a system lock zone by threads only.

Definition at line 241 of file chobjfifos.h.

References chGuardedPoolFreeS(), and ch_objects_fifo::free.

Here is the call graph for this function:

◆ chFifoReturnObject()

void chFifoReturnObject ( objects_fifo_t * ofp,
void * objp )
inlinestatic

Releases a fetched object.

Parameters
[in]ofppointer to a objects_fifo_t structure
[in]objppointer to the object to be released
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 255 of file chobjfifos.h.

References chGuardedPoolFree(), and ch_objects_fifo::free.

Here is the call graph for this function:

◆ chFifoSendObjectI()

void chFifoSendObjectI ( objects_fifo_t * ofp,
void * objp )
inlinestatic

Posts an object.

Note
By design the object can be always immediately posted.
Parameters
[in]ofppointer to a objects_fifo_t structure
[in]objppointer to the object to be posted
Function Class:
This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.

Definition at line 270 of file chobjfifos.h.

References chDbgAssert, chMBPostI(), ch_objects_fifo::mbx, and MSG_OK.

Here is the call graph for this function:

◆ chFifoSendObjectS()

void chFifoSendObjectS ( objects_fifo_t * ofp,
void * objp )
inlinestatic

Posts an object.

Note
By design the object can be always immediately posted.
Parameters
[in]ofppointer to a objects_fifo_t structure
[in]objppointer to the object to be posted
Function Class:
This is an S-Class API, this function can be invoked from within a system lock zone by threads only.

Definition at line 287 of file chobjfifos.h.

References chDbgAssert, chMBPostTimeoutS(), ch_objects_fifo::mbx, MSG_OK, and TIME_IMMEDIATE.

Here is the call graph for this function:

◆ chFifoSendObject()

void chFifoSendObject ( objects_fifo_t * ofp,
void * objp )
inlinestatic

Posts an object.

Note
By design the object can be always immediately posted.
Parameters
[in]ofppointer to a objects_fifo_t structure
[in]objppointer to the object to be released
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 304 of file chobjfifos.h.

References chDbgAssert, chMBPostTimeout(), ch_objects_fifo::mbx, MSG_OK, and TIME_IMMEDIATE.

Here is the call graph for this function:

◆ chFifoSendObjectAheadI()

void chFifoSendObjectAheadI ( objects_fifo_t * ofp,
void * objp )
inlinestatic

Posts an high priority object.

Note
By design the object can be always immediately posted.
Parameters
[in]ofppointer to a objects_fifo_t structure
[in]objppointer to the object to be posted
Function Class:
This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.

Definition at line 321 of file chobjfifos.h.

References chDbgAssert, chMBPostAheadI(), ch_objects_fifo::mbx, and MSG_OK.

Here is the call graph for this function:

◆ chFifoSendObjectAheadS()

void chFifoSendObjectAheadS ( objects_fifo_t * ofp,
void * objp )
inlinestatic

Posts an high priority object.

Note
By design the object can be always immediately posted.
Parameters
[in]ofppointer to a objects_fifo_t structure
[in]objppointer to the object to be posted
Function Class:
This is an S-Class API, this function can be invoked from within a system lock zone by threads only.

Definition at line 338 of file chobjfifos.h.

References chDbgAssert, chMBPostAheadTimeoutS(), ch_objects_fifo::mbx, MSG_OK, and TIME_IMMEDIATE.

Here is the call graph for this function:

◆ chFifoSendObjectAhead()

void chFifoSendObjectAhead ( objects_fifo_t * ofp,
void * objp )
inlinestatic

Posts an high priority object.

Note
By design the object can be always immediately posted.
Parameters
[in]ofppointer to a objects_fifo_t structure
[in]objppointer to the object to be released
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 355 of file chobjfifos.h.

References chDbgAssert, chMBPostAheadTimeout(), ch_objects_fifo::mbx, MSG_OK, and TIME_IMMEDIATE.

Here is the call graph for this function:

◆ chFifoReceiveObjectI()

msg_t chFifoReceiveObjectI ( objects_fifo_t * ofp,
void ** objpp )
inlinestatic

Fetches an object.

Parameters
[in]ofppointer to a objects_fifo_t structure
[in]objpppointer to the fetched object reference
Returns
The operation status.
Return values
MSG_OKif an object has been correctly fetched.
MSG_TIMEOUTif the FIFO is empty and a message cannot be fetched.
Function Class:
This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.

Definition at line 374 of file chobjfifos.h.

References chMBFetchI(), and ch_objects_fifo::mbx.

Here is the call graph for this function:

◆ chFifoReceiveObjectTimeoutS()

msg_t chFifoReceiveObjectTimeoutS ( objects_fifo_t * ofp,
void ** objpp,
sysinterval_t timeout )
inlinestatic

Fetches an object.

Parameters
[in]ofppointer to a objects_fifo_t structure
[in]objpppointer to the fetched object reference
[in]timeoutthe number of ticks before the operation timeouts, the following special values are allowed:
  • TIME_IMMEDIATE immediate timeout.
  • TIME_INFINITE no timeout.
Returns
The operation status.
Return values
MSG_OKif an object has been correctly fetched.
MSG_TIMEOUTif the operation has timed out.
Function Class:
This is an S-Class API, this function can be invoked from within a system lock zone by threads only.

Definition at line 396 of file chobjfifos.h.

References chMBFetchTimeoutS(), and ch_objects_fifo::mbx.

Here is the call graph for this function:

◆ chFifoReceiveObjectTimeout()

msg_t chFifoReceiveObjectTimeout ( objects_fifo_t * ofp,
void ** objpp,
sysinterval_t timeout )
inlinestatic

Fetches an object.

Parameters
[in]ofppointer to a objects_fifo_t structure
[in]objpppointer to the fetched object reference
[in]timeoutthe number of ticks before the operation timeouts, the following special values are allowed:
  • TIME_IMMEDIATE immediate timeout.
  • TIME_INFINITE no timeout.
Returns
The operation status.
Return values
MSG_OKif an object has been correctly fetched.
MSG_TIMEOUTif the operation has timed out.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 419 of file chobjfifos.h.

References chMBFetchTimeout(), and ch_objects_fifo::mbx.

Here is the call graph for this function: