|
XenevaOS
|
#include <aurora.h>
Go to the source code of this file.
Classes | |
| struct | _au_page_desc_ |
Macros | |
| #define | AURORA_PAGE_KERNEL (1ULL<<0) |
| #define | AURORA_PAGE_SHM (1ULL<<1) |
| #define | AURORA_PAGE_DMA (1ULL<<2) |
| #define | AURORA_PAGE_NORMAL (1ULL << 3) |
Typedefs | |
| typedef struct _au_page_desc_ | AuPageDesc |
Functions | |
| void | AuPmmngrInitialize (KERNEL_BOOT_INFO *info) |
| AuPmmngrInitialise – initialise the physical memory manager. | |
| AU_EXTERN AU_EXPORT void * | AuPmmngrAlloc () |
| AuPmmngrAlloc – Allocate a single physical page frame and return it to the caller. | |
| AU_EXTERN AU_EXPORT void * | AuPmmngrAllocBlocks (int num) |
| AuPmmngrAllocBlocks – Allocate multiple physical page frames and return the first page pointer to the caller. | |
| AU_EXTERN AU_EXPORT void | AuPmmngrFree (void *Address) |
| AuPmmngrFree – Free a physical page frame. | |
| AU_EXTERN AU_EXPORT void | AuPmmngrFreeBlocks (void *Addr, int Count) |
| AuPmmngrFreeBlocks – Free multiple page frames. | |
| AU_EXTERN AU_EXPORT uint64_t | P2V (uint64_t addr) |
| P2V – Physical to Virtual conversion. | |
| AU_EXTERN AU_EXPORT uint64_t | V2P (uint64_t vaddr) |
| V2P – Virtual to Physical conversion. | |
| void | AuPmmngrMoveHigher () |
| AuPmmngrMoveHigher – moves the kernel to higher half of memory. | |
| uint64_t | AuPmmngrGetFreeMem () |
| AuPmmngrGetFreeMem – returns the total free amount of RAM. | |
| uint64_t | AuPmmngrGetTotalMem () |
| AuPmmngrGetTotalMem – returns the total amount of RAM. | |
| void | AuPmmngrAddRefcount (uint64_t physaddr, uint16_t count) |
| AuPmmngrAddRefcount – increment reference count of given page. | |
| uint16_t | AuPmmngrGetRefcount (uint64_t physaddr) |
| AuPmmngrGetRefcount – returns the number of reference count for given physical address. | |
| AuPageDesc * | AuPmmngrGetPageDesc (uint64_t physaddr) |
| AuPmmngrGetPageDesc – return the correct page descriptor of given physical address. | |
| void | AuPmmngrSetPageType (uint64_t physaddr, uint8_t flags) |
| AuPmmngrSetPageType – set page type. | |
BSD 2-Clause License
Copyright (c) 2022, 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.
| #define AURORA_PAGE_DMA (1ULL<<2) |
| #define AURORA_PAGE_KERNEL (1ULL<<0) |
| #define AURORA_PAGE_NORMAL (1ULL << 3) |
| #define AURORA_PAGE_SHM (1ULL<<1) |
| typedef struct _au_page_desc_ AuPageDesc |
AuPageDesc – stores metadata about each physical page
AuPmmngrAddRefcount – increment reference count of given page.
| physaddr | – Physical address to increase reference count of |
| count | – number of count to increase |
AuPmmngrAlloc – Allocate a single physical page frame and return it to the caller.
AuPmmngrAllocBlocks – Allocate multiple physical page frames and return the first page pointer to the caller.
| size | – Number of blocks to allocate |
AuPmmngrFree – Free a physical page frame.
| Address | – Pointer to physical page |
AuPmmngrFreeBlocks – Free multiple page frames.
| Addr | – Address of the first page frame |
| Count | – Number of blocks to be freed |
|
extern |
AuPmmngrGetFreeMem – returns the total free amount of RAM.
|
extern |
AuPmmngrGetPageDesc – return the correct page descriptor of given physical address.
| physaddr | – physical address number |
AuPmmngrGetRefcount – returns the number of reference count for given physical address.
| physaddr | – physical address to check for reference count |
|
extern |
AuPmmngrGetTotalMem – returns the total amount of RAM.
|
extern |
AuPmmngrInitialise – initialise the physical memory manager.
| info | – Pointer to kernel boot info structure |
|
extern |
AuPmmngrMoveHigher – moves the kernel to higher half of memory.
AuPmmngrSetPageType – set page type.
| physaddr | – Physical address to treat |
| flags | – type flags |
check if page is kernel or dma, if yes then normal bit should be removed, because kernel will treat kernel or dma pages differently
P2V – Physical to Virtual conversion.
| addr | – Address to convert |