mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 10:53:16 +01:00
Lots of polishing, organizational changes, bug fixes, error handling etc. are introduced. COPY and NEW space thread creation are allowed but not thoroughly tested yet. It seems they will work best if the lib supports utcb virtual range management through the mapping.
28 lines
696 B
C
28 lines
696 B
C
/*
|
|
* Address allocation pool.
|
|
*
|
|
* Copyright (C) 2007 Bahadir Balban
|
|
*/
|
|
#ifndef __ADDR_H__
|
|
#define __ADDR_H__
|
|
|
|
#include <idpool.h>
|
|
|
|
/* Address pool to allocate from a range of addresses */
|
|
struct address_pool {
|
|
struct id_pool *idpool;
|
|
unsigned long start;
|
|
unsigned long end;
|
|
};
|
|
|
|
int address_pool_init_with_idpool(struct address_pool *pool,
|
|
struct id_pool *idpool,
|
|
unsigned long start, unsigned long end);
|
|
int address_pool_init(struct address_pool *pool,
|
|
unsigned long start, unsigned long end,
|
|
int size);
|
|
void *address_new(struct address_pool *pool, int nitems, int size);
|
|
int address_del(struct address_pool *, void *addr, int nitems, int size);
|
|
|
|
#endif /* __ADDR_H__ */
|