Files
codezero/tasks/mm0/include/lib/addr.h
Bahadir Balban 95b7b65c89 Pager virtual address pool bookkeeping added for all pager virtual addresses
Previously virt_to_phys/phys_to_virt macros were used such that they did a
blind offset translation for creating a pager internal virtual address for
user mappings.

This is now changed such that a properly bookkeeped virtual address pool is
used which will avoid any clashes on the virtual space.
2009-08-19 14:44:36 +03:00

27 lines
671 B
C

/*
* Address allocation pool
*
* Copyright (C) 2007 Bahadir Balban
*/
#ifndef __ADDR_H__
#define __ADDR_H__
#include <lib/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);
void *address_new(struct address_pool *pool, int npages);
int address_del(struct address_pool *, void *addr, int npages);
#endif /* __ADDR_H__ */