mirror of
https://git.stationery.faith/corn/corn.git
synced 2024-11-10 06:02:08 +00:00
25 lines
513 B
C
25 lines
513 B
C
|
#pragma once
|
||
|
|
||
|
#ifndef MEMORY_INTERNAL
|
||
|
#error "Do not include headers from <memory/___.h>, only use <memory.h>"
|
||
|
#endif
|
||
|
|
||
|
/**
|
||
|
* Initalizes the virtual address allocator
|
||
|
*/
|
||
|
void virtaddr_init(void);
|
||
|
|
||
|
/**
|
||
|
* Allocate a virtual address of length x pages
|
||
|
* @param pages - x pages
|
||
|
* @returns virt addr
|
||
|
*/
|
||
|
void *virtaddr_alloc(int pages);
|
||
|
|
||
|
/**
|
||
|
* Free the virtual address from virtaddr_alloc
|
||
|
* @param virtaddr - the addr to free
|
||
|
* @returns number of pages used for virtaddr
|
||
|
*/
|
||
|
long virtaddr_free(void *virtaddr);
|