L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
shmc.h
Go to the documentation of this file.
1
5/*
6 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
7 * Björn Döbel <doebel@os.inf.tu-dresden.de>
8 * economic rights: Technische Universität Dresden (Germany)
9 * This file is part of TUD:OS and distributed under the terms of the
10 * GNU Lesser General Public License 2.1.
11 * Please see the COPYING-LGPL-2.1 file for details.
12 */
13#pragma once
14
15#include <l4/sys/linkage.h>
16#include <l4/sys/types.h>
17#include <l4/sys/err.h>
18
69#define __INCLUDED_FROM_L4SHMC_H__
70#include <l4/shmc/types.h>
71
73
86L4_CV long
87l4shmc_create(char const *shmc_name);
88
110L4_CV long
111l4shmc_attach(char const *shmc_name, l4shmc_area_t *shmarea);
112
121L4_CV long
122l4shmc_get_client_nr(l4shmc_area_t const *shmarea);
123
136L4_CV long
137l4shmc_mark_client_initialized(l4shmc_area_t *shmarea);
138
151L4_CV long
152l4shmc_get_initialized_clients(l4shmc_area_t *shmarea, l4_umword_t *bitmask);
153
166L4_CV long
167l4shmc_add_chunk(l4shmc_area_t *shmarea, char const *chunk_name,
168 l4_umword_t chunk_capacity, l4shmc_chunk_t *chunk);
169
181L4_CV long
182l4shmc_add_signal(l4shmc_area_t *shmarea, char const *signal_name,
183 l4shmc_signal_t *signal);
184
194L4_CV L4_INLINE long
195l4shmc_trigger(l4shmc_signal_t *signal);
196
206L4_CV L4_INLINE long
207l4shmc_chunk_try_to_take(l4shmc_chunk_t *chunk);
208
220L4_CV L4_INLINE long
222
237L4_CV L4_INLINE long
239
249L4_CV L4_INLINE long
251
262L4_CV L4_INLINE long
263l4shmc_chunk_ready(l4shmc_chunk_t *chunk, l4_umword_t size);
264
275L4_CV L4_INLINE long
276l4shmc_chunk_ready_sig(l4shmc_chunk_t *chunk, l4_umword_t size);
277
289L4_CV L4_INLINE long
290l4shmc_get_chunk(l4shmc_area_t *shmarea, char const *chunk_name,
291 l4shmc_chunk_t *chunk);
292
306L4_CV long
307l4shmc_get_chunk_to(l4shmc_area_t *shmarea, char const *chunk_name,
308 l4_umword_t timeout_ms, l4shmc_chunk_t *chunk);
309
323L4_CV long
324l4shmc_iterate_chunk(l4shmc_area_t const *shmarea, char const **chunk_name,
325 long offs);
326
339L4_CV long
340l4shmc_attach_signal(l4shmc_area_t *shmarea, char const *signal_name,
341 l4_cap_idx_t thread, l4shmc_signal_t *signal);
342
343
355L4_CV long
356l4shmc_get_signal(l4shmc_area_t *shmarea, char const *signal_name,
357 l4shmc_signal_t *signal);
358
372L4_CV long
373l4shmc_enable_signal(l4shmc_signal_t *signal);
374
388L4_CV long
389l4shmc_enable_chunk(l4shmc_chunk_t *chunk);
390
400L4_CV L4_INLINE long
401l4shmc_wait_any(l4shmc_signal_t **retsignal);
402
416L4_CV L4_INLINE long
417l4shmc_wait_any_try(l4shmc_signal_t **retsignal);
418
433L4_CV long
434l4shmc_wait_any_to(l4_timeout_t timeout, l4shmc_signal_t **retsignal);
435
445L4_CV L4_INLINE long
446l4shmc_wait_signal(l4shmc_signal_t *signal);
447
458L4_CV long
459l4shmc_wait_signal_to(l4shmc_signal_t *signal, l4_timeout_t timeout);
460
474L4_CV L4_INLINE long
475l4shmc_wait_signal_try(l4shmc_signal_t *signal);
476
486L4_CV L4_INLINE long
487l4shmc_wait_chunk(l4shmc_chunk_t *chunk);
488
503L4_CV long
504l4shmc_wait_chunk_to(l4shmc_chunk_t *chunk, l4_timeout_t timeout);
505
519L4_CV L4_INLINE long
520l4shmc_wait_chunk_try(l4shmc_chunk_t *chunk);
521
531L4_CV L4_INLINE long
532l4shmc_chunk_consumed(l4shmc_chunk_t *chunk);
533
544L4_CV long
545l4shmc_connect_chunk_signal(l4shmc_chunk_t *chunk, l4shmc_signal_t *signal);
546
556L4_CV L4_INLINE long
557l4shmc_is_chunk_ready(l4shmc_chunk_t const *chunk);
558
568L4_CV L4_INLINE long
569l4shmc_is_chunk_clear(l4shmc_chunk_t const *chunk);
570
579L4_CV L4_INLINE void *
580l4shmc_chunk_ptr(l4shmc_chunk_t const *chunk);
581
590L4_CV L4_INLINE long
591l4shmc_chunk_size(l4shmc_chunk_t const *chunk);
592
601L4_CV L4_INLINE long
602l4shmc_chunk_capacity(l4shmc_chunk_t const *chunk);
603
613L4_CV L4_INLINE l4shmc_signal_t *
614l4shmc_chunk_signal(l4shmc_chunk_t const *chunk);
615
625l4shmc_signal_cap(l4shmc_signal_t const *signal);
626
636L4_CV L4_INLINE long
637l4shmc_check_magic(l4shmc_chunk_t const *chunk);
638
648L4_CV long
649l4shmc_area_size(l4shmc_area_t const *shmarea);
650
660L4_CV long
661l4shmc_area_size_free(l4shmc_area_t const *shmarea);
662
669L4_CV long
671
679L4_CV long
681
682#include <l4/shmc/internal.h>
683
Error codes.
long l4shmc_chunk_overhead(void)
Get memory overhead required in addition to the chunk capacity for adding one chunk.
long l4shmc_area_overhead(void)
Get memory overhead per area that is not available for chunks.
long l4shmc_connect_chunk_signal(l4shmc_chunk_t *chunk, l4shmc_signal_t *signal)
Connect a signal with a chunk.
long l4shmc_mark_client_initialized(l4shmc_area_t *shmarea)
Mark this shared memory client as 'initialized'.
long l4shmc_area_size(l4shmc_area_t const *shmarea)
Get size of shared memory area.
long l4shmc_get_initialized_clients(l4shmc_area_t *shmarea, l4_umword_t *bitmask)
Fetch the _clients_init_done bitmask of the shared memory area.
long l4shmc_attach(char const *shmc_name, l4shmc_area_t *shmarea)
Attach to a shared memory area.
long l4shmc_create(char const *shmc_name)
Create a shared memory area.
long l4shmc_get_client_nr(l4shmc_area_t const *shmarea)
Determine the client number of the shared memory region.
long l4shmc_area_size_free(l4shmc_area_t const *shmarea)
Get free size of shared memory area.
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_wait_chunk(l4shmc_chunk_t *chunk)
Wait on a specific chunk.
long l4shmc_chunk_size(l4shmc_chunk_t const *chunk)
Get current size of a 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_enable_chunk(l4shmc_chunk_t *chunk)
Enable a signal connected with a chunk.
long l4shmc_chunk_try_to_take_for_reading(l4shmc_chunk_t *chunk)
Try to mark chunk busy reading.
long l4shmc_chunk_ready_sig(l4shmc_chunk_t *chunk, l4_umword_t size)
Mark chunk as filled (ready) and signal consumer.
long l4shmc_is_chunk_clear(l4shmc_chunk_t const *chunk)
Check whether chunk is free.
long l4shmc_chunk_try_to_take_for_overwriting(l4shmc_chunk_t *chunk)
Try to mark the chunk busy writing after it was ready for reading.
long l4shmc_chunk_try_to_take_for_writing(l4shmc_chunk_t *chunk)
Try to mark chunk busy writing.
long l4shmc_chunk_ready(l4shmc_chunk_t *chunk, l4_umword_t size)
Mark chunk as filled (ready).
long l4shmc_chunk_try_to_take(l4shmc_chunk_t *chunk)
Try to mark chunk busy.
long l4shmc_iterate_chunk(l4shmc_area_t const *shmarea, char const **chunk_name, long offs)
Iterate over names of all existing chunks.
long l4shmc_get_chunk(l4shmc_area_t *shmarea, char const *chunk_name, l4shmc_chunk_t *chunk)
Get chunk out of shared memory area.
l4shmc_signal_t * l4shmc_chunk_signal(l4shmc_chunk_t const *chunk)
Get the registered signal of a 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.
long l4shmc_chunk_capacity(l4shmc_chunk_t const *chunk)
Get capacity of a chunk.
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.
void * l4shmc_chunk_ptr(l4shmc_chunk_t const *chunk)
Get data pointer to chunk.
long l4shmc_enable_signal(l4shmc_signal_t *signal)
Enable a signal.
long l4shmc_wait_signal_try(l4shmc_signal_t *signal)
Check whether a specific signal has an event pending.
long l4shmc_wait_any(l4shmc_signal_t **retsignal)
Wait on any signal.
long l4shmc_wait_signal(l4shmc_signal_t *signal)
Wait on a specific signal.
long l4shmc_wait_signal_to(l4shmc_signal_t *signal, l4_timeout_t timeout)
Wait on a specific signal, with timeout.
long l4shmc_wait_any_try(l4shmc_signal_t **retsignal)
Check whether any waited signal has an event pending.
long l4shmc_wait_any_to(l4_timeout_t timeout, l4shmc_signal_t **retsignal)
Wait for any signal with timeout.
long l4shmc_trigger(l4shmc_signal_t *signal)
Trigger a signal.
long l4shmc_attach_signal(l4shmc_area_t *shmarea, char const *signal_name, l4_cap_idx_t thread, l4shmc_signal_t *signal)
Attach to signal.
long l4shmc_get_signal(l4shmc_area_t *shmarea, char const *signal_name, l4shmc_signal_t *signal)
Get signal object from the shared memory area.
l4_cap_idx_t l4shmc_signal_cap(l4shmc_signal_t const *signal)
Get the signal capability of a signal.
long l4shmc_check_magic(l4shmc_chunk_t const *chunk)
Check magic value of a chunk.
long l4shmc_add_signal(l4shmc_area_t *shmarea, char const *signal_name, l4shmc_signal_t *signal)
Add a signal for the shared memory area.
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:51
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:359
#define __END_DECLS
End section with C types and functions.
Definition compiler.h:199
#define L4_CV
Define calling convention.
Definition linkage.h:44
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:62
#define __BEGIN_DECLS
Start section with C types and functions.
Definition compiler.h:196
Common L4 ABI Data Types.
Timeout pair.
Definition __timeout.h:61