30#include <kernel/types.h>
32#include <utils/bits.h>
106bool mmu_map(vaddr_t virt, paddr_t physical,
int prot);
119bool mmu_map_range(vaddr_t virt, paddr_t physical,
size_t size,
int prot);
182 mmu_policy_t policy);
#define IS_ERR(_x)
Check if an integer can be interpreted as an error.
Definition: error.h:87
paddr_t mmu_find_physical(vaddr_t)
Find the physical mapping of a virtual address.
Definition: mmu.c:526
void mmu_clone(paddr_t destination)
Clone the current MMU inside another one.
Definition: mmu.c:333
mmu_prot
Protection flags passed to the mmu's functions.
Definition: mmu.h:40
bool mmu_map(vaddr_t virt, paddr_t physical, int prot)
Map a virtual address to a physical one.
Definition: mmu.c:376
mmu_caching_policy
Caching policies.
Definition: mmu.h:52
void mmu_unmap_range(vaddr_t start, vaddr_t end)
Unmap a range of virtual addresses.
Definition: mmu.c:507
void mmu_destroy(paddr_t mmu)
Release the MMU's page_directory.
Definition: mmu.c:224
paddr_t mmu_unmap(vaddr_t virt)
Unmap a virtual address.
Definition: mmu.c:473
error_t mmu_copy_on_write(vaddr_t)
Try to remap a potential copy-on-write mapping.
Definition: mmu.c:540
void mmu_identity_map(paddr_t start, paddr_t end, int prot)
Perform identity mapping inside a given virtual address range.
Definition: mmu.c:521
paddr_t mmu_new(void)
Allocate and initialize a new page directory.
Definition: mmu.c:198
error_t mmu_set_policy_range(vaddr_t range_start, size_t range_size, mmu_policy_t policy)
Configure the caching policy in effect when accessing a range of pages.
Definition: mmu.c:312
bool mmu_init(void)
Initialize the MMU's paging system.
Definition: mmu.c:693
bool mmu_map_range(vaddr_t virt, paddr_t physical, size_t size, int prot)
Map a range of virtual addresses to physical ones.
Definition: mmu.c:429
error_t mmu_set_policy(vaddr_t, mmu_policy_t policy)
Configure the caching policy in effect when accessing a page.
Definition: mmu.c:295
static bool mmu_is_mapped(vaddr_t addr)
Definition: mmu.h:161
void mmu_load(paddr_t mmu)
Replace the current page directory.
Definition: mmu.c:180
@ PROT_READ
Definition: mmu.h:43
@ PROT_WRITE
Definition: mmu.h:45
@ PROT_EXEC
Definition: mmu.h:42
@ PROT_NONE
Definition: mmu.h:41
@ PROT_KERNEL
Definition: mmu.h:46
@ POLICY_UC
Definition: mmu.h:53
@ POLICY_WB
Definition: mmu.h:56
@ POLICY_WT
Definition: mmu.h:55
@ POLICY_WC
Definition: mmu.h:54
#define BIT(_n)
Generate the nth power of 2 (nth bit set)
Definition: bits.h:20