L4Re - L4 Runtime Environment
+ Collaboration diagram for Chunks:

Modules

 Consumer
 
 Producer
 

Functions

long l4shmc_add_chunk (l4shmc_area_t *shmarea, const char *chunk_name, l4_umword_t chunk_capacity, l4shmc_chunk_t *chunk)
 Add a chunk in the shared memory area. More...
 
long l4shmc_get_chunk (l4shmc_area_t *shmarea, const char *chunk_name, l4shmc_chunk_t *chunk)
 Get chunk out of shared memory area. More...
 
long l4shmc_get_chunk_to (l4shmc_area_t *shmarea, const char *chunk_name, l4_umword_t timeout_ms, l4shmc_chunk_t *chunk)
 Get chunk out of shared memory area, with timeout. More...
 
long l4shmc_iterate_chunk (l4shmc_area_t *shmarea, const char **chunk_name, long offs)
 Iterate over names of all existing chunks. More...
 
void * l4shmc_chunk_ptr (l4shmc_chunk_t *chunk)
 Get data pointer to chunk. More...
 
long l4shmc_chunk_capacity (l4shmc_chunk_t *chunk)
 Get capacity of a chunk. More...
 
l4shmc_signal_t * l4shmc_chunk_signal (l4shmc_chunk_t *chunk)
 Get the signal of a chunk. More...
 

Detailed Description

Function Documentation

◆ l4shmc_add_chunk()

long l4shmc_add_chunk ( l4shmc_area_t *  shmarea,
const char *  chunk_name,
l4_umword_t  chunk_capacity,
l4shmc_chunk_t *  chunk 
)

Add a chunk in the shared memory area.

Parameters
shmareaThe shared memory area to put the chunk in.
chunk_nameName of the chunk.
chunk_capacityCapacity for payload of the chunk in bytes.
[out]chunkChunk structure to fill in.
Return values
0Success.
<0Error.
Examples:
examples/libs/shmc/prodcons.c.

◆ l4shmc_chunk_capacity()

long l4shmc_chunk_capacity ( l4shmc_chunk_t *  chunk)
inline

Get capacity of a chunk.

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

◆ l4shmc_chunk_ptr()

void* l4shmc_chunk_ptr ( l4shmc_chunk_t *  chunk)
inline

Get data pointer to chunk.

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

◆ l4shmc_chunk_signal()

l4shmc_signal_t* l4shmc_chunk_signal ( l4shmc_chunk_t *  chunk)
inline

Get the signal of a chunk.

Parameters
chunkChunk.
Return values
0No signal has been registered with this chunk.
>0Pointer to signal otherwise.

◆ l4shmc_get_chunk()

long l4shmc_get_chunk ( l4shmc_area_t *  shmarea,
const char *  chunk_name,
l4shmc_chunk_t *  chunk 
)
inline

Get chunk out of shared memory area.

Parameters
shmareaShared memory area.
chunk_nameName of the chunk.
[out]chunkChunk data structure to fill.
Return values
0Success.
<0Error.
Examples:
examples/libs/shmc/prodcons.c.

◆ l4shmc_get_chunk_to()

long l4shmc_get_chunk_to ( l4shmc_area_t *  shmarea,
const char *  chunk_name,
l4_umword_t  timeout_ms,
l4shmc_chunk_t *  chunk 
)

Get chunk out of shared memory area, with timeout.

Parameters
shmareaShared memory area.
chunk_nameName of the chunk.
timeout_msTimeout in milliseconds to wait for the chunk to appear in the shared memory area.
[out]chunkChunk data structure to fill.
Return values
0Success.
<0Error.

◆ l4shmc_iterate_chunk()

long l4shmc_iterate_chunk ( l4shmc_area_t *  shmarea,
const char **  chunk_name,
long  offs 
)

Iterate over names of all existing chunks.

Parameters
shmareaShared memory area.
chunk_nameWhere the name of the current chunk will be stored
offs0 to start iteration, return value of previous call to l4shmc_iterate_chunk() to get next chunk
Return values
0No more chunks available.
<0Error.
>0Iterator value for the next call.