aboutsummaryrefslogtreecommitdiff
path: root/kernel/inc/mm.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/inc/mm.h')
-rw-r--r--kernel/inc/mm.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/inc/mm.h b/kernel/inc/mm.h
index aad4ffd..6a1c063 100644
--- a/kernel/inc/mm.h
+++ b/kernel/inc/mm.h
@@ -16,6 +16,7 @@ struct memory_range {
*/
struct memory_range physical_alloc(u32 size);
+void physical_free(struct memory_range range);
/**
* Virtual
@@ -70,11 +71,14 @@ struct page_dir {
union page_dir_entry entries[PAGE_COUNT];
} PACKED;
+u8 virtual_present(struct page_dir *dir, u32 vaddr);
u32 virtual_to_physical(struct page_dir *dir, u32 vaddr);
void virtual_map(struct page_dir *dir, struct memory_range prange, u32 vaddr, u32 flags);
struct memory_range virtual_alloc(struct page_dir *dir, struct memory_range physical_range,
u32 flags);
+void virtual_free(struct page_dir *dir, struct memory_range vrange);
struct page_dir *virtual_create_dir(void);
+void virtual_destroy_dir(struct page_dir *dir);
struct page_dir *virtual_kernel_dir(void);
/**
@@ -89,10 +93,13 @@ struct page_dir *virtual_kernel_dir(void);
struct memory_range memory_range_from(u32 base, u32 size);
struct memory_range memory_range_around(u32 base, u32 size);
-void memory_install(struct mem_info *mem_info);
void *memory_alloc(struct page_dir *dir, u32 size, u32 flags);
void *memory_alloc_identity(struct page_dir *dir, u32 flags);
+void memory_map_identity(struct page_dir *dir, struct memory_range prange, u32 flags);
void memory_free(struct page_dir *dir, struct memory_range vrange);
void memory_switch_dir(struct page_dir *dir);
+void memory_backup_dir(struct page_dir **backup);
+
+void memory_install(struct mem_info *mem_info);
#endif