diff options
author | Freya Murphy <freya@freyacat.org> | 2024-01-28 19:22:09 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-01-28 19:22:09 -0500 |
commit | 6957948f3af47f5b57770ac1692843bba768c285 (patch) | |
tree | 247d3709d6414fa68a582b9bd6e8deb62547760c /include/memory/physalloc.h | |
parent | Merge remote-tracking branch 'origin/main' (diff) | |
download | corn-6957948f3af47f5b57770ac1692843bba768c285.tar.gz corn-6957948f3af47f5b57770ac1692843bba768c285.tar.bz2 corn-6957948f3af47f5b57770ac1692843bba768c285.zip |
memory changes
Diffstat (limited to '')
-rw-r--r-- | include/memory/physalloc.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/memory/physalloc.h b/include/memory/physalloc.h new file mode 100644 index 0000000..f22432e --- /dev/null +++ b/include/memory/physalloc.h @@ -0,0 +1,30 @@ +#pragma once + +#ifndef MEMORY_INTERNAL + #error "Do not include headers from <memory/___.h>, only use <memory.h>" +#endif + +/** + * Allocates a single physical page in memory + * @preturns the physical address of the page + */ +extern void *alloc_phys_page(void); + +/** + * Allocates count physical pages in memory + * @returns the physical address of the first page + */ +extern void *alloc_phys_pages(int count); + +/** +* Frees a single physical page in memory + * @param ptr - the physical address of the page + */ +extern void free_phys_page(void *ptr); + +/** + * Frees count physical pages in memory + * @param ptr - the physical address of the first page + * @param count - the number of pages in the list + */ +extern void free_phys_pages(void *ptr, int count); |