ChibiOS/RT  5.1.0
Collaboration diagram for Objects FIFOs:

Detailed Description

Typedefs

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

Data Structures

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

Functions

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

Typedef Documentation

Type of an objects FIFO.

Function Documentation

static void chFifoObjectInit ( 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]objsizesize of objects
[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 objealign alignment
[in]msgbufpointer to the buffer of messages, it must be able to hold objn messages
Function Class:
Initializer, this function just initializes an object and can be invoked before the kernel is initialized.

Definition at line 132 of file chfifo.h.

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

Referenced by chFactoryCreateObjectsFIFO().

Here is the call graph for this function:

static 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 150 of file chfifo.h.

References chGuardedPoolAllocI(), and ch_objects_fifo::free.

Here is the call graph for this function:

static 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 170 of file chfifo.h.

References chGuardedPoolAllocTimeoutS(), and ch_objects_fifo::free.

Here is the call graph for this function:

static 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 191 of file chfifo.h.

References chGuardedPoolAllocTimeout(), and ch_objects_fifo::free.

Here is the call graph for this function:

static 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 205 of file chfifo.h.

References chGuardedPoolFreeI(), and ch_objects_fifo::free.

Here is the call graph for this function:

static 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 219 of file chfifo.h.

References chGuardedPoolFreeS(), and ch_objects_fifo::free.

Here is the call graph for this function:

static 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 233 of file chfifo.h.

References chGuardedPoolFree(), and ch_objects_fifo::free.

Here is the call graph for this function:

static 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 248 of file chfifo.h.

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

Here is the call graph for this function:

static 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 265 of file chfifo.h.

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

Here is the call graph for this function:

static 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 282 of file chfifo.h.

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

Here is the call graph for this function:

static 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 299 of file chfifo.h.

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

Here is the call graph for this function:

static 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 316 of file chfifo.h.

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

Here is the call graph for this function:

static 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 333 of file chfifo.h.

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

Here is the call graph for this function:

static 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 352 of file chfifo.h.

References chMBFetchI(), and ch_objects_fifo::mbx.

Here is the call graph for this function:

static 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 374 of file chfifo.h.

References chMBFetchTimeoutS(), and ch_objects_fifo::mbx.

Here is the call graph for this function:

static 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 397 of file chfifo.h.

References chMBFetchTimeout(), and ch_objects_fifo::mbx.

Here is the call graph for this function: