#include <x86/proc_reg.h>
#include <console.h>
#include <interrupt.h>
#include <malloc.h>
#include <string.h>
#include <stdio.h>
#include <frame.h>
#include <thread.h>
#include <task.h>
#include <vm.h>
Functions | |
void | page_fault_handler (ExceptionVector vector, ExceptionData data, Registers *registers) |
int | vm_initialize (Task *task) |
Initialize virtual memory. | |
unsigned int | unmapped_pt0_entries (PageTableEntry *pt0, MemoryAddress address, MemoryAddress end) |
void | flush_tlb (void) |
void | vm_context_switch (Task *task) |
Context switch into a task's address space. | |
int | map_memory_region (Task *task, PageTableEntry *pt0, PageTableEntry *pt1, MemoryRegion *region, MemoryAddress start, MemoryAddress end) |
void | unmap_memory_region (PageTableEntry *pt0, PageTableEntry *pt1, MemoryRegion *region) |
int | vm_map (Task *task, MemoryRegion *region) |
Map a memory region into a task's address space. | |
int | vm_unmap (Task *task, MemoryRegion *region) |
Unmap a memory region from a task's address space. | |
int | vm_validate (MemoryAddress address, MemoryAddress end, unsigned int protection) |
Validates that a memory region is mapped. | |
int | vm_validate_string (MemoryAddress address, unsigned int type) |
Validates that a memory region is mapped. | |
MemoryRegion * | memory_region_find (Task *task, MemoryAddress address) |
Finds a memory region by address. | |
MemoryRegion * | memory_region_create (Task *task, unsigned int protection, MemoryAddress address, MemoryAddress end, MemoryFaultHandler faultHandler) |
Creates a new memory region in a task's address space. | |
void | memory_region_destroy (MemoryRegion *region) |
Destroys a memory region. | |
int | fork_memory_regions (Task *dst, Task *src) |
void | initialize_pt0 (PageTableEntry *pt0, Frame *frame) |
void | copy_user_space (PageTableEntry *pt0) |
int | vm_fork (Task *task) |
Forks a new task from the current task. | |
int | vm_copy (Task *task, MemoryAddress dst, char *src, unsigned int len) |
Copies data into a specified task's address space. | |
int | stack_fault_handler (MemoryRegion *region, MemoryAddress address, Registers *registers) |
Hassaan Moin Khan (hkhan)
|
Creates a new memory region in a task's address space. Creates a new memory region in the tasks address space, for a given protection and fault behavior.
|
|
Destroys a memory region. Free frames associated with a memory region.
|
|
Finds a memory region by address. Find a memory region in a task by an address that falls within the region.
|
|
Context switch into a task's address space. Installs the page directory of the specified task as the current page directory.
|
|
Copies data into a specified task's address space. Copies data from the current address space into a target address space by utilizing the temporary mapping space.
|
|
Forks a new task from the current task. Forks a new address space that is a copy of the current task into the specified task.
|
|
Initialize virtual memory. Initializes the virtual memory system with the specified init task.
|
|
Map a memory region into a task's address space. Map a memory region into a task's address space, allocating page tables as necessary.
|
|
Unmap a memory region from a task's address space. Unset all the page table entries associated with a memory region in the task's address space.
|
|
Validates that a memory region is mapped. Checks if the specified region of the current task's address space is mapped as user memory with the specified protection.
|
|
Validates that a memory region is mapped. Checks if the specified region of the current task's address space is mapped as user readable, where the memory region is a string containing elements of a specified size with an unknown extent, ending at a 0 element.
|