|
XenevaOS
|
#include <Mm\vmmngr.h>#include <Mm\pmmngr.h>#include <aucon.h>#include <Hal\x86_64_lowlevel.h>#include <Hal\x86_64_cpu.h>#include <string.h>#include <_null.h>#include <Hal\serial.h>
Macros | |
| #define | CANONICAL_MASK 0xFFFFffffFFFFUL |
Functions | |
| size_t | x86_64_pml4_index (uint64_t addr) |
| size_t | x86_64_pdp_index (uint64_t addr) |
| size_t | x86_64_pd_index (uint64_t addr) |
| size_t | x86_64_pt_index (uint64_t addr) |
| size_t | x86_64_p_index (uint64_t addr) |
| void | Au_x86_64_Paging_Init () |
| AuVPage * | AuVmmngrGetPage (uint64_t virt_addr, uint8_t _flags, uint8_t mode) |
| bool | AuMapPage (uint64_t phys_addr, uint64_t virt_addr, uint8_t attrib) |
| AuMapPage – Maps a virtual page to physical frame. | |
| bool | AuMapPageEx (uint64_t *pml4i, uint64_t phys_addr, uint64_t virt_addr, uint8_t attrib) |
| AuMapPageEx – Maps a virtual page to physical frame in given page level. | |
| void * | AuMapMMIO (uint64_t phys_addr, size_t page_count) |
| AuMapMMIO – Maps Memory Mapped I/O addresses. | |
| uint64_t * | AuGetFreePage (bool user, void *ptr) |
| AuGetFreePage – Checks for free page. | |
| void | AuFreePages (uint64_t virt_addr, bool free_physical, size_t s) |
| AuFreePages – frees up contiguous pages. | |
| void * | AuGetPhysicalAddress (uint64_t virt_addr) |
| AuGetPhysicalAddress – returns the physical address from a virtual address. | |
| void * | AuGetPhysicalAddressEx (uint64_t *cr3, uint64_t virt_addr) |
| uint64_t * | AuCreateVirtualAddressSpace () |
| AuCreateVirtualAddressSpace – create a new virtual address space. | |
| uint64_t * | AuGetRootPageTable () |
| void | AuVmmngrInitialize () |
| AuVmmngrInitialize – initialize the virtual memory manager. | |
| void | AuVmmngrBootFree () |
| void | AuVmmngrCloneAddressSpace (uint64_t *destcr3, uint64_t *srccr3) |
| AuVmmngrCloneAddressSpace – clones a given address space. | |
Variables | |
| uint64_t * | _RootPaging |
| uint64_t * | _MmioBase |
| #define CANONICAL_MASK 0xFFFFffffFFFFUL |
| void Au_x86_64_Paging_Init | ( | ) |
| uint64_t * AuCreateVirtualAddressSpace | ( | ) |
AuCreateVirtualAddressSpace – create a new virtual address space.
AuFreePages – frees up contiguous pages.
| virt_addr | – starting virtual address |
| free_physical | – free up physical frame |
| size_t | s – size of area to be freed |
AuGetFreePage – Checks for free page.
| user | – specifies if it needs to look from user base address |
| ptr | – if it is non-null, than lookup begins from given pointer |
| void * AuGetPhysicalAddress | ( | uint64_t | virt_addr | ) |
AuGetPhysicalAddress – returns the physical address from a virtual address.
| virt_addr | – Virtual address |
| uint64_t * AuGetRootPageTable | ( | ) |
AuMapMMIO – Maps Memory Mapped I/O addresses.
| phys_addr | – MMIO physical address |
| page_count | – number of pages |
AuMapPage – Maps a virtual page to physical frame.
| phys_addr | – physical address |
| virt_addr | – virtual address |
| attrib | – Page attributes |
AuMapPageEx – Maps a virtual page to physical frame in given page level.
| pml4i | – root page level pointer |
| phys_addr | – physical address |
| virt_addr | – virtual address |
| attrib | – Page attributes |
| void AuVmmngrBootFree | ( | ) |
@breif AuVmmngrBootFree – free up the lower half of kernel address space
AuVmmngrCloneAddressSpace – clones a given address space.
| destcr3 | – destination cr3 |
| srccr3 | – source cr3 |
@breif AuVmmngrGetPage – Returns virtual page from virtual address in AuVPage format
| virt_addr | – Virtual address |
| _flags | – extra virtual page flags, this is set only if mode is set to VMMNGR_GETPAGE_CREATE |
| mode | – specifies whether to create a virtual page if its not present |
| void AuVmmngrInitialize | ( | ) |
AuVmmngrInitialize – initialize the virtual memory manager.
| uint64_t* _MmioBase |
| uint64_t* _RootPaging |
BSD 2-Clause License
Copyright (c) 2022-2023, Manas Kamal Choudhury All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.