diff options
Diffstat (limited to 'include/sys/virtalloc.h')
-rw-r--r-- | include/sys/virtalloc.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/sys/virtalloc.h b/include/sys/virtalloc.h new file mode 100644 index 0000000..c4bac56 --- /dev/null +++ b/include/sys/virtalloc.h @@ -0,0 +1,24 @@ +#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); |