Main Page   File List  

alloc.h

Go to the documentation of this file.
00001 
00009 /* (c) 2004 Technische Universitaet Dresden
00010  * This file is part of DROPS, which is distributed under the terms of the
00011  * GNU General Public License 2. Please see the COPYING file for details.
00012  */
00013 #ifndef __UTIL_INCLUDE_ALLOC_H_
00014 #define __UTIL_INCLUDE_ALLOC_H_
00015 #include <l4/sys/l4int.h>
00016 #include <l4/util/bitops.h>
00017 #include <l4/sys/compiler.h>
00018 
00019 EXTERN_C_BEGIN
00020 
00021 typedef struct {
00022     int base, count, next_elem;
00023     l4_umword_t *bits;
00024 } l4util_alloc_t;
00025 
00026 #define L4UTIL_ALLOC_BITS_SIZE (8 * sizeof(l4_umword_t))
00027 
00028 L4_CV l4util_alloc_t *l4util_alloc_init(int count, int base);
00029 L4_CV int l4util_alloc_avail(l4util_alloc_t *alloc, int elem);
00030 L4_CV int l4util_alloc_occupy(l4util_alloc_t *alloc, int elem);
00031 L4_CV int l4util_alloc_alloc(l4util_alloc_t *alloc);
00032 L4_CV int l4util_alloc_free(l4util_alloc_t *alloc, int elem);
00033 
00034 EXTERN_C_END
00035 #endif

L4 Utilities, part of DROPS  © 2000-2003