This commit is contained in:
2026-07-15 22:09:13 +02:00
commit cf33867e68
152 changed files with 9663 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
#pragma once
#include <zinnia/mem.h>
#include <zinnia/status.h>
#include <kernel/mutex.h>
#include <kernel/pmap.h>
#include <kernel/vmo.h>
// Virtual address space.
struct vas {
// Architecture-specific virtual memory map implementation.
struct pmap pmap;
};
// Try to create a new, empty virtual address space.
zn_status_t vma_new(struct vas** out);
// Delete a virtual address space.
void vma_delete(struct vas* vm);
zn_status_t vma_map_vmo(
struct vas* vm,
struct vmo* vmo,
uintptr_t addr,
size_t len,
enum zn_vm_flags flags,
uintptr_t vmo_offset
);
// Remove any mappings in the given address range.
zn_status_t vma_unmap(struct vas* vm, uintptr_t vaddr, size_t size);
// Change the protection of an existing mapping.
zn_status_t vma_protect(struct vas* vm, uintptr_t vaddr, size_t size, enum zn_vm_flags flags);
// Try to handle a page fault.
bool vma_page_fault(struct vas* vm, uintptr_t vaddr, enum zn_vm_flags access_type);
extern struct vas kernel_vas;