diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2021-12-19 10:48:40 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2021-12-19 10:48:40 +0200 |
| commit | 8bb1e280280c2f30740defca68ea643c56a3d880 (patch) | |
| tree | 6cc0e6ea37554b5c397a0987c21807950e931cdf /include/apos/vmem.h | |
| parent | 383e55e6bb725a01f652a9fb74f6103b2c789793 (diff) | |
| download | kmi-8bb1e280280c2f30740defca68ea643c56a3d880.tar.gz kmi-8bb1e280280c2f30740defca68ea643c56a3d880.zip | |
[WIP] virtual memory management
Diffstat (limited to 'include/apos/vmem.h')
| -rw-r--r-- | include/apos/vmem.h | 29 |
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 */ |
