opuntiaOS - an operating system targeting x86 and ARMv7
at master 826 B view raw
1/* 2 * Copyright (C) 2020-2022 The opuntiaOS Project Authors. 3 * + Contributed by Nikita Melekhin <nimelehin@gmail.com> 4 * 5 * Use of this source code is governed by a BSD-style license that can be 6 * found in the LICENSE file. 7 */ 8 9#ifndef _KERNEL_MEM_VM_ALLOC_H 10#define _KERNEL_MEM_VM_ALLOC_H 11 12#include <libkern/libkern.h> 13#include <mem/bits/vm.h> 14#include <mem/kmemzone.h> 15 16uintptr_t vm_alloc_pdir_paddr(); 17uintptr_t vm_alloc_ptable_paddr(); 18uintptr_t vm_alloc_ptables_to_cover_page(); 19void vm_free_ptables_to_cover_page(uintptr_t addr); 20uintptr_t vm_alloc_page_paddr(); 21void vm_free_page_paddr(uintptr_t addr); 22 23kmemzone_t vm_alloc_mapped_zone(size_t size, size_t alignment); 24int vm_free_mapped_zone(kmemzone_t zone); 25 26pdirectory_t* vm_alloc_pdir(); 27void vm_free_pdir(pdirectory_t* pdir); 28 29#endif // _KERNEL_MEM_VM_ALLOC_H