L4Re - L4 Runtime Environment
alloc.h
Go to the documentation of this file.
1 
9 /*
10  * (c) 2004-2009 Author(s)
11  * economic rights: Technische Universit├Ąt Dresden (Germany)
12  * This file is part of TUD:OS and distributed under the terms of the
13  * GNU Lesser General Public License 2.1.
14  * Please see the COPYING-LGPL-2.1 file for details.
15  */
16 #ifndef __UTIL_INCLUDE_ALLOC_H_
17 #define __UTIL_INCLUDE_ALLOC_H_
18 #include <l4/sys/l4int.h>
19 #include <l4/util/bitops.h>
20 #include <l4/sys/compiler.h>
21 
23 
24 typedef struct {
25  int base, count, next_elem;
26  l4_umword_t *bits;
27 } l4util_alloc_t;
28 
29 #define L4UTIL_ALLOC_BITS_SIZE (8 * sizeof(l4_umword_t))
30 
31 L4_CV l4util_alloc_t *l4util_alloc_init(int count, int base);
32 L4_CV int l4util_alloc_avail(l4util_alloc_t *alloc, int elem);
33 L4_CV int l4util_alloc_occupy(l4util_alloc_t *alloc, int elem);
34 L4_CV int l4util_alloc_alloc(l4util_alloc_t *alloc);
35 L4_CV int l4util_alloc_free(l4util_alloc_t *alloc, int elem);
36 
38 #endif
#define EXTERN_C_END
End section with C types and functions.
Definition: compiler.h:187
bit manipulation functions
L4 compiler related defines.
unsigned long l4_umword_t
Unsigned machine word.
Definition: l4int.h:52
#define EXTERN_C_BEGIN
Start section with C types and functions.
Definition: compiler.h:186
#define L4_CV
Define calling convention.
Definition: linkage.h:44