23 #ifndef _XENO_NUCLEUS_MAP_H
24 #define _XENO_NUCLEUS_MAP_H
29 #include <nucleus/types.h>
31 #define XNMAP_MAX_KEYS (BITS_PER_LONG * BITS_PER_LONG)
33 typedef struct xnmap {
40 #define __IDMAP_LONGS ((XNMAP_MAX_KEYS+BITS_PER_LONG-1)/BITS_PER_LONG)
41 unsigned long lomap[__IDMAP_LONGS];
62 int ofkey = key - map->offset;
63 return map->objarray[ofkey];
68 int ofkey = key - map->offset;
70 if (ofkey < 0 || ofkey >= map->nkeys)
73 return map->objarray[ofkey];
int xnmap_remove(xnmap_t *map, int key)
Remove an object reference from a map.
Definition: map.c:250
int xnmap_enter(xnmap_t *map, int key, void *objaddr)
Index an object into a map.
Definition: map.c:180
xnmap_t * xnmap_create(int nkeys, int reserve, int offset)
Create a map.
Definition: map.c:91
static void * xnmap_fetch_nocheck(xnmap_t *map, int key)
Search an object into a map - unchecked form.
Definition: map.h:60
void xnmap_delete(xnmap_t *map)
Delete a map.
Definition: map.c:137
static void * xnmap_fetch(xnmap_t *map, int key)
Search an object into a map.
Definition: map.h:66