3 * \brief Allocator using a bit-array
6 * \author Jork Loeser <jork.loeser@inf.tu-dresden.de>
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.
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>
25 int base, count, next_elem;
29 #define L4UTIL_ALLOC_BITS_SIZE (8 * sizeof(l4_umword_t))
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);