2007-10-15 10:41:08 -04:00
|
|
|
#ifndef IKARUS_AT
|
|
|
|
#define IKARUS_AT
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
|
|
|
|
#define segment_pages (8 * sizeof(unsigned int))
|
|
|
|
|
|
|
|
typedef struct ikat_ll{
|
|
|
|
unsigned char* base;
|
2007-10-15 17:58:03 -04:00
|
|
|
size_t size;
|
2007-10-15 10:41:08 -04:00
|
|
|
struct ikat_ll* next;
|
|
|
|
} ikat_ll;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
unsigned int* alloc_table;
|
2007-10-15 17:58:03 -04:00
|
|
|
ikat_ll** lls;
|
|
|
|
int lls_count;
|
|
|
|
unsigned char* ap;
|
|
|
|
unsigned char* ep;
|
2007-10-15 10:41:08 -04:00
|
|
|
ikat_ll* llcache;
|
|
|
|
} ikat;
|
|
|
|
|
2007-10-15 17:58:03 -04:00
|
|
|
ikat* ikat_make_allocation_table(unsigned int types);
|
2007-10-15 10:41:08 -04:00
|
|
|
|
|
|
|
void ikat_free_allocation_table(ikat*);
|
|
|
|
|
|
|
|
unsigned char* ikat_map_bigpage(ikat*, size_t size);
|
|
|
|
|
|
|
|
unsigned char* ikat_map(ikat*, size_t size, unsigned int type);
|
|
|
|
|
|
|
|
unsigned char* ikat_map_code(ikat*, size_t size, unsigned int type);
|
|
|
|
|
2007-10-15 17:58:03 -04:00
|
|
|
void ikat_unmap(ikat*, unsigned char* addr, size_t size);
|
2007-10-15 10:41:08 -04:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|