L4Re - L4 Runtime Environment
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Chunks
+ 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.
long l4shmc_get_chunk (l4shmc_area_t *shmarea, const char *chunk_name, l4shmc_chunk_t *chunk)
 Get chunk out of shared memory area.
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.
long l4shmc_iterate_chunk (l4shmc_area_t *shmarea, const char **chunk_name, long offs)
 Iterate over names of all existing chunks.
void * l4shmc_chunk_ptr (l4shmc_chunk_t *chunk)
 Get data pointer to chunk.
long l4shmc_chunk_capacity (l4shmc_chunk_t *chunk)
 Get capacity of a chunk.
l4shmc_signal_t * l4shmc_chunk_signal (l4shmc_chunk_t *chunk)
 Get the signal of a chunk.

Detailed Description

Function Documentation

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.
Return values
chunkChunk structure to fill in.
Returns
0 on success, <0 on error
Examples:
examples/libs/shmc/prodcons.c.
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.
Return values
chunkChunk data structure to fill.
Returns
0 on success, <0 on error
Examples:
examples/libs/shmc/prodcons.c.
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.
Return values
chunkchunk data structure to fill.
Returns
0 on success, <0 on error
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
Returns
<0 on error, 0 if no more chunks, >0 iterator value for next call
void* l4shmc_chunk_ptr ( l4shmc_chunk_t *  chunk)
inline

Get data pointer to chunk.

Parameters
chunkChunk.
Returns
0 on success, <0 on error
Examples:
examples/libs/shmc/prodcons.c.
long l4shmc_chunk_capacity ( l4shmc_chunk_t *  chunk)
inline

Get capacity of a chunk.

Parameters
chunkChunk.
Returns
0 on success, <0 on error
l4shmc_signal_t* l4shmc_chunk_signal ( l4shmc_chunk_t *  chunk)
inline

Get the signal of a chunk.

Parameters
chunkChunk.
Returns
0 if no signal has been register with this chunk, signal otherwise
L4Re - L4 Runtime Environment