#ifndef VA2PA_H_ #define VA2PA_H_ #include #include "rib.h" // to store page frame numbers typedef uintptr_t pfn; //int assign(struct va2pa * map, int size, unsigned va, unsigned pa); // store vpn->pfn map of a contiguous memory area from /proc/self/pagemap // map - pointer array of pfn // area - pointer to start of the area (must be page aligned) // size - size of the area in bytes (must be page aligned) unsigned va_to_pa(pfn * map, void * area, size_t size); // try to allocate memory area where virtual and physical pages belong to same sets // size - amount to allocate (page-size aligned) // pageset - how many sets of pages to take into account void * smart_alloc(size_t size, unsigned pagesets, bool executable = false); #endif /*VA2PA_H_*/