3 * \file ferret/include/sensors/__llist_consumer.h
4 * \brief locked list consumer functions.
7 * \author Martin Pohlack <mp26@os.inf.tu-dresden.de>
10 * (c) 2007-2009 Technische Universität Dresden
11 * This file is part of TUD:OS and distributed under the terms of the
12 * GNU General Public License 2.
13 * Please see the COPYING-GPL-2 file for details.
15 #if FERRET_LLIST_MAGIC != ahK6eeNa
16 #error Do not directly include this file, use a proper wrapper!
18 #undef FERRET_LLIST_MAGIC
20 #include <l4/sys/compiler.h>
24 /* Consumer local part of the data structure. Allocated and
25 * initialized locally.
29 ferret_common_t header; // copy of the header, all
30 // sensors should start with
32 ferret_llist_index_t next_read; // event to read next
33 uint64_t lost; // number of events lost so far
34 PREFIX(t) * glob; // pointer to globally shared area
35 char * out_buf; // pointer to output element buffer
36 #ifdef FERRET_LLIST_HAVE_LOCAL_LOCK
37 PREFIX(local_lock_t) llock; // address space specific part of the lock
44 * @param list locked list sensor to get elements from
45 * @param el pointer to memory area to copy retrieved element to
50 int PREFIX(get)(PREFIX(moni_t) * list, ferret_list_entry_t * el);
53 * @brief Setup local struct for sensor
55 * @param addr pointer pointer to global memory area
56 * @retval addr pointer to new local area
58 void PREFIX(init_consumer)(void ** addr);
61 * @brief De-allocate locale memory area
63 * @param addr pointer pointer to local memory area
64 * @retval addr pointer to global memory
66 void PREFIX(free_consumer)(void ** addr);