Loading...
Searching...
No Matches
shmc.h
Go to the documentation of this file.
/*
* (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
* Björn Döbel <doebel@os.inf.tu-dresden.de>
* economic rights: Technische Universität Dresden (Germany)
* This file is part of TUD:OS and distributed under the terms of the
* GNU Lesser General Public License 2.1.
* Please see the COPYING-LGPL-2.1 file for details.
*/
#pragma once
#include <l4/sys/compiler.h>
#include <l4/sys/linkage.h>
#include <l4/sys/types.h>
#include <l4/sys/err.h>
#define __INCLUDED_FROM_L4SHMC_H__
#include <l4/shmc/types.h>
L4_BEGIN_DECLS
L4_CV long
l4shmc_create(char const *shmc_name);
L4_CV long
l4shmc_attach(char const *shmc_name, l4shmc_area_t *shmarea);
L4_CV long
l4shmc_get_client_nr(l4shmc_area_t const *shmarea);
L4_CV long
l4shmc_mark_client_initialized(l4shmc_area_t *shmarea);
L4_CV long
l4shmc_get_initialized_clients(l4shmc_area_t *shmarea, l4_umword_t *bitmask);
L4_CV long
l4shmc_add_chunk(l4shmc_area_t *shmarea, char const *chunk_name,
l4_umword_t chunk_capacity, l4shmc_chunk_t *chunk);
L4_CV long
l4shmc_add_signal(l4shmc_area_t *shmarea, char const *signal_name,
l4shmc_signal_t *signal);
L4_CV L4_INLINE long
l4shmc_trigger(l4shmc_signal_t *signal);
L4_CV L4_INLINE long
l4shmc_chunk_try_to_take(l4shmc_chunk_t *chunk);
L4_CV L4_INLINE long
l4shmc_chunk_try_to_take_for_writing(l4shmc_chunk_t *chunk);
L4_CV L4_INLINE long
l4shmc_chunk_try_to_take_for_overwriting(l4shmc_chunk_t *chunk);
L4_CV L4_INLINE long
l4shmc_chunk_try_to_take_for_reading(l4shmc_chunk_t *chunk);
L4_CV L4_INLINE long
l4shmc_chunk_ready(l4shmc_chunk_t *chunk, l4_umword_t size);
L4_CV L4_INLINE long
l4shmc_chunk_ready_sig(l4shmc_chunk_t *chunk, l4_umword_t size);
L4_CV L4_INLINE long
l4shmc_get_chunk(l4shmc_area_t *shmarea, char const *chunk_name,
l4shmc_chunk_t *chunk);
L4_CV long
l4shmc_get_chunk_to(l4shmc_area_t *shmarea, char const *chunk_name,
l4_umword_t timeout_ms, l4shmc_chunk_t *chunk);
L4_CV long
l4shmc_iterate_chunk(l4shmc_area_t const *shmarea, char const **chunk_name,
long offs);
L4_CV long
l4shmc_attach_signal(l4shmc_area_t *shmarea, char const *signal_name,
l4_cap_idx_t thread, l4shmc_signal_t *signal);
L4_CV long
l4shmc_get_signal(l4shmc_area_t *shmarea, char const *signal_name,
l4shmc_signal_t *signal);
L4_CV long
l4shmc_enable_signal(l4shmc_signal_t *signal);
L4_CV long
l4shmc_enable_chunk(l4shmc_chunk_t *chunk);
L4_CV L4_INLINE long
l4shmc_wait_any(l4shmc_signal_t **retsignal);
L4_CV L4_INLINE long
l4shmc_wait_any_try(l4shmc_signal_t **retsignal);
L4_CV long
l4shmc_wait_any_to(l4_timeout_t timeout, l4shmc_signal_t **retsignal);
L4_CV L4_INLINE long
l4shmc_wait_signal(l4shmc_signal_t *signal);
L4_CV long
l4shmc_wait_signal_to(l4shmc_signal_t *signal, l4_timeout_t timeout);
L4_CV L4_INLINE long
l4shmc_wait_signal_try(l4shmc_signal_t *signal);
L4_CV L4_INLINE long
l4shmc_wait_chunk(l4shmc_chunk_t *chunk);
L4_CV long
l4shmc_wait_chunk_to(l4shmc_chunk_t *chunk, l4_timeout_t timeout);
L4_CV L4_INLINE long
l4shmc_wait_chunk_try(l4shmc_chunk_t *chunk);
L4_CV L4_INLINE long
l4shmc_chunk_consumed(l4shmc_chunk_t *chunk);
L4_CV long
l4shmc_connect_chunk_signal(l4shmc_chunk_t *chunk, l4shmc_signal_t *signal);
L4_CV L4_INLINE long
l4shmc_is_chunk_ready(l4shmc_chunk_t const *chunk);
L4_CV L4_INLINE long
l4shmc_is_chunk_clear(l4shmc_chunk_t const *chunk);
L4_CV L4_INLINE void *
l4shmc_chunk_ptr(l4shmc_chunk_t const *chunk);
L4_CV L4_INLINE long
l4shmc_chunk_size(l4shmc_chunk_t const *chunk);
L4_CV L4_INLINE long
l4shmc_chunk_capacity(l4shmc_chunk_t const *chunk);
L4_CV L4_INLINE l4shmc_signal_t *
l4shmc_chunk_signal(l4shmc_chunk_t const *chunk);
L4_CV L4_INLINE l4_cap_idx_t
l4shmc_signal_cap(l4shmc_signal_t const *signal);
L4_CV L4_INLINE long
l4shmc_check_magic(l4shmc_chunk_t const *chunk);
L4_CV long
l4shmc_area_size(l4shmc_area_t const *shmarea);
L4_CV long
l4shmc_area_size_free(l4shmc_area_t const *shmarea);
L4_CV long
l4shmc_area_overhead(void);
L4_CV long
l4shmc_chunk_overhead(void);
#include <l4/shmc/internal.h>
L4_END_DECLS
compiler.h
L4 compiler related defines.
err.h
Error codes.
l4shmc_chunk_overhead
long l4shmc_chunk_overhead(void)
Get memory overhead required in addition to the chunk capacity for adding one chunk.
l4shmc_area_overhead
long l4shmc_area_overhead(void)
Get memory overhead per area that is not available for chunks.
l4shmc_create
L4_BEGIN_DECLS long l4shmc_create(char const *shmc_name)
Create a shared memory area.
l4shmc_connect_chunk_signal
long l4shmc_connect_chunk_signal(l4shmc_chunk_t *chunk, l4shmc_signal_t *signal)
Connect a signal with a chunk.
l4shmc_mark_client_initialized
long l4shmc_mark_client_initialized(l4shmc_area_t *shmarea)
Mark this shared memory client as 'initialized'.
l4shmc_area_size
long l4shmc_area_size(l4shmc_area_t const *shmarea)
Get size of shared memory area.
l4shmc_get_initialized_clients
long l4shmc_get_initialized_clients(l4shmc_area_t *shmarea, l4_umword_t *bitmask)
Fetch the _clients_init_done bitmask of the shared memory area.
l4shmc_attach
long l4shmc_attach(char const *shmc_name, l4shmc_area_t *shmarea)
Attach to a shared memory area.
l4shmc_get_client_nr
long l4shmc_get_client_nr(l4shmc_area_t const *shmarea)
Determine the client number of the shared memory region.
l4shmc_area_size_free
long l4shmc_area_size_free(l4shmc_area_t const *shmarea)
Get free size of shared memory area.
l4shmc_wait_chunk_try
long l4shmc_wait_chunk_try(l4shmc_chunk_t *chunk)
Check whether a specific chunk has an event pending.
l4shmc_chunk_consumed
long l4shmc_chunk_consumed(l4shmc_chunk_t *chunk)
Mark a chunk as free.
l4shmc_is_chunk_ready
long l4shmc_is_chunk_ready(l4shmc_chunk_t const *chunk)
Check whether data is available.
l4shmc_wait_chunk
long l4shmc_wait_chunk(l4shmc_chunk_t *chunk)
Wait on a specific chunk.
l4shmc_chunk_size
long l4shmc_chunk_size(l4shmc_chunk_t const *chunk)
Get current size of a chunk.
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.
l4shmc_enable_chunk
long l4shmc_enable_chunk(l4shmc_chunk_t *chunk)
Enable a signal connected with a chunk.
l4shmc_chunk_try_to_take_for_reading
long l4shmc_chunk_try_to_take_for_reading(l4shmc_chunk_t *chunk)
Try to mark chunk busy reading.
l4shmc_chunk_ready_sig
long l4shmc_chunk_ready_sig(l4shmc_chunk_t *chunk, l4_umword_t size)
Mark chunk as filled (ready) and signal consumer.
l4shmc_is_chunk_clear
long l4shmc_is_chunk_clear(l4shmc_chunk_t const *chunk)
Check whether chunk is free.
l4shmc_chunk_try_to_take_for_overwriting
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.
l4shmc_chunk_try_to_take_for_writing
long l4shmc_chunk_try_to_take_for_writing(l4shmc_chunk_t *chunk)
Try to mark chunk busy writing.
l4shmc_chunk_ready
long l4shmc_chunk_ready(l4shmc_chunk_t *chunk, l4_umword_t size)
Mark chunk as filled (ready).
l4shmc_chunk_try_to_take
long l4shmc_chunk_try_to_take(l4shmc_chunk_t *chunk)
Try to mark chunk busy.
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.
l4shmc_get_chunk
long l4shmc_get_chunk(l4shmc_area_t *shmarea, char const *chunk_name, l4shmc_chunk_t *chunk)
Get chunk out of shared memory area.
l4shmc_chunk_signal
l4shmc_signal_t * l4shmc_chunk_signal(l4shmc_chunk_t const *chunk)
Get the registered signal of a chunk.
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.
l4shmc_chunk_capacity
long l4shmc_chunk_capacity(l4shmc_chunk_t const *chunk)
Get capacity of a chunk.
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.
l4shmc_chunk_ptr
void * l4shmc_chunk_ptr(l4shmc_chunk_t const *chunk)
Get data pointer to chunk.
l4shmc_enable_signal
long l4shmc_enable_signal(l4shmc_signal_t *signal)
Enable a signal.
l4shmc_wait_signal_try
long l4shmc_wait_signal_try(l4shmc_signal_t *signal)
Check whether a specific signal has an event pending.
l4shmc_wait_any
long l4shmc_wait_any(l4shmc_signal_t **retsignal)
Wait on any signal.
l4shmc_wait_signal
long l4shmc_wait_signal(l4shmc_signal_t *signal)
Wait on a specific signal.
l4shmc_wait_signal_to
long l4shmc_wait_signal_to(l4shmc_signal_t *signal, l4_timeout_t timeout)
Wait on a specific signal, with timeout.
l4shmc_wait_any_try
long l4shmc_wait_any_try(l4shmc_signal_t **retsignal)
Check whether any waited signal has an event pending.
l4shmc_wait_any_to
long l4shmc_wait_any_to(l4_timeout_t timeout, l4shmc_signal_t **retsignal)
Wait for any signal with timeout.
l4shmc_trigger
long l4shmc_trigger(l4shmc_signal_t *signal)
Trigger a signal.
l4shmc_attach_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.
l4shmc_get_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.
l4shmc_signal_cap
l4_cap_idx_t l4shmc_signal_cap(l4shmc_signal_t const *signal)
Get the signal capability of a signal.
l4shmc_check_magic
long l4shmc_check_magic(l4shmc_chunk_t const *chunk)
Check magic value of a chunk.
l4shmc_add_signal
long l4shmc_add_signal(l4shmc_area_t *shmarea, char const *signal_name, l4shmc_signal_t *signal)
Add a signal for the shared memory area.
l4_umword_t
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
l4_cap_idx_t
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:336
L4_CV
#define L4_CV
Define calling convention.
Definition linkage.h:33
L4_INLINE
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
L4_BEGIN_DECLS
#define L4_BEGIN_DECLS
Start section with C types and functions.
Definition compiler.h:165
L4_END_DECLS
#define L4_END_DECLS
End section with C types and functions.
Definition compiler.h:166
types.h
Common L4 ABI Data Types.
l4_timeout_t
Timeout pair.
Definition __timeout.h:53