MentOS
0.8.0
The Mentoring Operating System
|
Virtual memory mapping routines. More...
Go to the source code of this file.
Classes | |
struct | virt_map_page_manager_t |
Virtual mapping manager. More... | |
struct | virt_map_page_t |
Virtual mapping. More... | |
Macros | |
#define | VIRTUAL_MEMORY_SIZE_MB 128 |
Size of the virtual memory. | |
Typedefs | |
typedef struct virt_map_page_manager_t | virt_map_page_manager_t |
Virtual mapping manager. | |
typedef struct virt_map_page_t | virt_map_page_t |
Virtual mapping. | |
Functions | |
int | virt_init (void) |
Initialize the virtual memory mapper. More... | |
uint32_t | virt_map_physical_pages (page_t *page, int pfn_count) |
Maps physical pages to virtual memory. More... | |
virt_map_page_t * | virt_map_alloc (uint32_t size) |
Allocates virtual pages for a given size. More... | |
uint32_t | virt_map_vaddress (mm_struct_t *mm, virt_map_page_t *vpage, uint32_t vaddr, uint32_t size) |
Maps a virtual address to a virtual memory area. More... | |
int | virtual_check_address (uint32_t addr) |
Checks if an address belongs to the virtual memory mapping. More... | |
int | virt_unmap (uint32_t addr) |
Unmaps a virtual address from the virtual memory. More... | |
int | virt_unmap_pg (virt_map_page_t *page) |
Unmap a page. More... | |
void | virt_memcpy (mm_struct_t *dst_mm, uint32_t dst_vaddr, mm_struct_t *src_mm, uint32_t src_vaddr, uint32_t size) |
Memcpy from different processes virtual addresses. More... | |
Virtual memory mapping routines.
int virt_init | ( | void | ) |
Initialize the virtual memory mapper.
virt_map_page_t* virt_map_alloc | ( | uint32_t | size | ) |
Allocates virtual pages for a given size.
size | The size in bytes to allocate. |
Maps physical pages to virtual memory.
page | Pointer to the physical page. |
pfn_count | The number of page frames to map. |
uint32_t virt_map_vaddress | ( | mm_struct_t * | mm, |
virt_map_page_t * | vpage, | ||
uint32_t | vaddr, | ||
uint32_t | size | ||
) |
Maps a virtual address to a virtual memory area.
mm | Pointer to the memory management structure. |
vpage | Pointer to the virtual map page. |
vaddr | The virtual address to map. |
size | The size of the memory area to map. |
void virt_memcpy | ( | mm_struct_t * | dst_mm, |
uint32_t | dst_vaddr, | ||
mm_struct_t * | src_mm, | ||
uint32_t | src_vaddr, | ||
uint32_t | size | ||
) |
Memcpy from different processes virtual addresses.
dst_mm | The destination memory struct |
dst_vaddr | The destination memory address |
src_mm | The source memory struct |
src_vaddr | The source memory address |
size | The size in bytes of the copy |
int virt_unmap | ( | uint32_t | addr | ) |
Unmaps a virtual address from the virtual memory.
addr | The virtual address to unmap. |
int virt_unmap_pg | ( | virt_map_page_t * | page | ) |
Unmap a page.
page | Pointer to the page to unmap. |
int virtual_check_address | ( | uint32_t | addr | ) |
Checks if an address belongs to the virtual memory mapping.
addr | The address to check. |