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

Modules

 Consumer
 
 Producer
 

Functions

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

Detailed Description

Function Documentation

◆ l4shmc_add_chunk()

long l4shmc_add_chunk ( l4shmc_area_t *  shmarea,
char const *  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 const *  chunk)
inline

Get capacity of a chunk.

Parameters
chunkChunk.
Returns
Capacity of the chunk in bytes.

◆ l4shmc_chunk_ptr()

void * l4shmc_chunk_ptr ( l4shmc_chunk_t const *  chunk)
inline

Get data pointer to chunk.

Parameters
chunkChunk.
Returns
Chunk pointer.
Examples
examples/libs/shmc/prodcons.c.

◆ l4shmc_chunk_signal()

l4shmc_signal_t * l4shmc_chunk_signal ( l4shmc_chunk_t const *  chunk)
inline

Get the registered 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,
char const *  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,
char const *  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 const *  shmarea,
char const **  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.