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

Map entries: the mappings of an address space. More...

#include <core/system.h>
#include <mm/vm.h>

Go to the source code of this file.

Functions

struct vm_entry * vm_entry_new (void)
 Makes a new, empty map entry.
void vm_entry_destroy (struct vm_entry *vm_entry)
 Releases what a map entry holds: its references to its anon and its object.

Detailed Description

Map entries: the mappings of an address space.

A struct vm_entry is one mapping, a range of addresses with its permissions, and what its pages come from (an object, such as a file, and an anon for the pages the process wrote to).

Definition in file vm_entry.c.

Function Documentation

◆ vm_entry_destroy()

void vm_entry_destroy ( struct vm_entry * vm_entry)

Releases what a map entry holds: its references to its anon and its object.

The entry's structure itself is freed by its caller.

Parameters
vm_entrythe entry (NULL does nothing)

Definition at line 32 of file vm_entry.c.

References vm_entry::vm_anon, vm_anon_decref(), vm_entry_destroy(), vm_entry::vm_object, and vm_object_decref().

Referenced by sys_munmap(), vm_entry_destroy(), and vm_space_destroy().

◆ vm_entry_new()

struct vm_entry * vm_entry_new ( void )

Makes a new, empty map entry.

Returns
the entry, zeroed, or NULL if there was no memory for it

Definition at line 18 of file vm_entry.c.

References kmalloc(), M_ZERO, NULL, and vm_entry_new().

Referenced by binfmt_elf_load_segments(), sys_mmap(), and vm_entry_new().