AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
vmm.c File Reference

Mapping and unmapping a map entry's range in an address space, and the kernel's own address space (kvm_space). More...

#include <core/system.h>
#include <core/arch.h>
#include <core/panic.h>
#include <mm/mm.h>
#include <mm/vm.h>
#include <ds/queue.h>
#include <ds/hashmap.h>

Go to the source code of this file.

Functions

int vm_map (struct vm_space *vm_space, struct vm_entry *vm_entry)
 Maps a map entry's whole range at once: its physical memory (paddr), or new pages of memory if it has none.
void vm_unmap_full (struct vm_space *vm_space, struct vm_entry *vm_entry)
 Unmaps every page of a map entry's range.

Variables

struct vm_space kvm_space

Detailed Description

Mapping and unmapping a map entry's range in an address space, and the kernel's own address space (kvm_space).

Definition in file vmm.c.

Function Documentation

◆ vm_map()

int vm_map ( struct vm_space * vm_space,
struct vm_entry * vm_entry )

Maps a map entry's whole range at once: its physical memory (paddr), or new pages of memory if it has none.

Entries whose pages come in on page faults aren't mapped this way.

Parameters
vm_spacethe address space
vm_entrythe entry
Returns
0, or -ENOMEM if there was no memory for a page or a page table

Definition at line 29 of file vmm.c.

References vm_entry::base, vm_entry::flags, mm_map(), vm_entry::paddr, vm_space::pmap, vm_entry::size, and vm_map().

Referenced by acpi_map(), earlycon_fb_init(), fbdev_vesa_map(), fbdev_vesa_prope(), and vm_map().

◆ vm_unmap_full()

void vm_unmap_full ( struct vm_space * vm_space,
struct vm_entry * vm_entry )

Unmaps every page of a map entry's range.

The pages themselves stay with what holds them (the anon, the file, the device): only the mappings go.

Parameters
vm_spacethe address space
vm_entrythe entry

Definition at line 42 of file vmm.c.

References vm_entry::base, mm_unmap_full(), vm_space::pmap, vm_entry::size, and vm_unmap_full().

Referenced by sys_munmap(), and vm_unmap_full().

Variable Documentation

◆ kvm_space