L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
+ Collaboration diagram for Consumer:

Functions

long l4shmc_chunk_try_to_take_for_reading (l4shmc_chunk_t *chunk)
 Try to mark chunk busy reading.
 
long l4shmc_enable_chunk (l4shmc_chunk_t *chunk)
 Enable a signal connected with a chunk.
 
long l4shmc_wait_chunk (l4shmc_chunk_t *chunk)
 Wait on a specific chunk.
 
long l4shmc_wait_chunk_to (l4shmc_chunk_t *chunk, l4_timeout_t timeout)
 Check whether a specific chunk has an event pending, with timeout.
 
long l4shmc_wait_chunk_try (l4shmc_chunk_t *chunk)
 Check whether a specific chunk has an event pending.
 
long l4shmc_chunk_consumed (l4shmc_chunk_t *chunk)
 Mark a chunk as free.
 
long l4shmc_is_chunk_ready (l4shmc_chunk_t const *chunk)
 Check whether data is available.
 
long l4shmc_chunk_size (l4shmc_chunk_t const *chunk)
 Get current size of a chunk.
 

Detailed Description

Function Documentation

◆ l4shmc_chunk_consumed()

long l4shmc_chunk_consumed ( l4shmc_chunk_t *  chunk)
inline

Mark a chunk as free.

Parameters
chunkChunk to mark as free.
Return values
0Success.
<0Error.
Examples
examples/libs/shmc/prodcons.c.

◆ l4shmc_chunk_size()

long l4shmc_chunk_size ( l4shmc_chunk_t const *  chunk)
inline

Get current size of a chunk.

Parameters
chunkChunk.
Returns
Current size of the chunk in bytes.
Examples
examples/libs/shmc/prodcons.c.

◆ l4shmc_chunk_try_to_take_for_reading()

long l4shmc_chunk_try_to_take_for_reading ( l4shmc_chunk_t *  chunk)
inline

Try to mark chunk busy reading.

Parameters
chunkchunk to mark busy reading.
Return values
0Chunk could be taken and can be read.
<0Chunk could not be taken, try again.

◆ l4shmc_enable_chunk()

long l4shmc_enable_chunk ( l4shmc_chunk_t *  chunk)

Enable a signal connected with a chunk.

Parameters
chunkChunk to enable.
Return values
0Success.
<0Error.

A signal must be enabled before waiting when the consumer waits on any signal. Enabling is not needed if the consumer waits for a specific signal or chunk.

◆ l4shmc_is_chunk_ready()

long l4shmc_is_chunk_ready ( l4shmc_chunk_t const *  chunk)
inline

Check whether data is available.

Parameters
chunkChunk to check.
Return values
!=0Data is available.
0No data available.

◆ l4shmc_wait_chunk()

long l4shmc_wait_chunk ( l4shmc_chunk_t *  chunk)
inline

Wait on a specific chunk.

Parameters
chunkChunk to wait for.
Return values
0Success.
<0Error.
Examples
examples/libs/shmc/prodcons.c.

◆ l4shmc_wait_chunk_to()

long l4shmc_wait_chunk_to ( l4shmc_chunk_t *  chunk,
l4_timeout_t  timeout 
)

Check whether a specific chunk has an event pending, with timeout.

Parameters
chunkChunk to check.
timeoutTimeout.
Return values
0Success.
<0Error.

The return code indicates whether an event was pending or not. Success means an event was pending, if an receive timeout error is returned no event was pending.

◆ l4shmc_wait_chunk_try()

long l4shmc_wait_chunk_try ( l4shmc_chunk_t *  chunk)
inline

Check whether a specific chunk has an event pending.

Parameters
chunkChunk to check.
Return values
0Success.
<0Error.

The return code indicates whether an event was pending or not. Success means an event was pending, if an receive timeout error is returned no event was pending.