OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [include/] [l4/] [lib/] [idpool.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
#ifndef __IDPOOL_H__
2
#define __IDPOOL_H__
3
 
4
#include <l4/lib/bit.h>
5
#include <l4/lib/spinlock.h>
6
 
7
/* One page size minus the structure fields */
8
#define CONFIG_MAX_SYSTEM_IDS                   (1023*32)
9
#define SYSTEM_IDS_MAX                          (CONFIG_MAX_SYSTEM_IDS >> 5)
10
 
11
struct id_pool {
12
        struct spinlock lock;
13
        int nwords;
14
        u32 bitmap[SYSTEM_IDS_MAX];
15
};
16
 
17
struct id_pool_variable {
18
        struct spinlock lock;
19
        int nwords;
20
        u32 bitmap[];
21
};
22
 
23
struct id_pool *id_pool_new_init(int mapsize, void *buffer);
24
int id_new(struct id_pool *pool);
25
int id_del(struct id_pool *pool, int id);
26
int id_get(struct id_pool *pool, int id);
27
 
28
#endif /* __IDPOOL_H__ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.