aboutsummaryrefslogtreecommitdiff
path: root/include/apos/vmem.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/apos/vmem.h')
-rw-r--r--include/apos/vmem.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/include/apos/vmem.h b/include/apos/vmem.h
index e72f783..eb7ad17 100644
--- a/include/apos/vmem.h
+++ b/include/apos/vmem.h
@@ -1,11 +1,29 @@
#ifndef APOS_VMEM_H
#define APOS_VMEM_H
-#include <apos/pmem.h>
-
/* arch-specific data */
#include <vmem.h>
+/* common */
+#include <apos/pmem.h>
+#include <apos/sp_tree.h>
+
+struct sp_mem {
+ struct sp_node sp_n;
+
+ struct sp_mem *next;
+ struct sp_mem *prev;
+
+ char flags;
+
+ vm_t end;
+ vm_t start;
+};
+
+#define mem_container(ptr)\
+ container_of(ptr, struct sp_mem, sp_n)
+
+
/* general overview of the different functions:
* (un)map_vmem: map one known page of physical memory to one known page of
* virtual memory
@@ -29,11 +47,4 @@ vm_t map_vregion(struct vm_branch_t *branch, pm_t base, vm_t start, size_t size,
void unmap_vregion(struct vm_branch_t *branch, vm_t start);
void init_vmem(struct vm_branch_t *branch, vm_t tmp_pte);
-
-#if defined(KERNEL)
-void arch_init_vmem(struct vm_branch_t *branch, vm_t tmp_pte);
-#else
-struct vm_branch_t *arch_get_tmp_pte(struct vm_branch_t *branch);
-#endif
-
#endif /* APOS_VMEM_H */