2021-02-10 23:22:57 +01:00
|
|
|
#pragma once
|
|
|
|
#include "paging.h"
|
2021-08-09 09:26:10 +02:00
|
|
|
#include "stdarg.h"
|
2021-02-10 23:22:57 +01:00
|
|
|
|
2021-10-26 22:29:51 +02:00
|
|
|
/* Pure Virtual Memory Allocation */
|
|
|
|
|
|
|
|
// areaAlloc map vmem to phy pages
|
|
|
|
#define AREA_PHY_MAP (1<<0)
|
|
|
|
|
2021-08-19 16:44:47 +02:00
|
|
|
struct memArea {
|
|
|
|
vaddr_t startAddr;
|
|
|
|
uint nbPages;
|
|
|
|
|
|
|
|
struct memArea *next;
|
|
|
|
struct memArea *prev;
|
|
|
|
};
|
|
|
|
|
|
|
|
void areaInit(vaddr_t firstMemUsed, vaddr_t lastUsed);
|
2021-10-26 22:29:51 +02:00
|
|
|
vaddr_t areaAlloc(unsigned int nbPages, uint32_t flags);
|
2021-04-10 00:24:02 +02:00
|
|
|
int areaFree(vaddr_t addr);
|
2021-08-09 09:26:10 +02:00
|
|
|
int areaAdd(vaddr_t addr, uint nbPages, int isFree);
|