XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
pmmngr.h File Reference
#include <aurora.h>
Include dependency graph for pmmngr.h:

Go to the source code of this file.

Classes

struct  _au_pmm_stats_
 
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)
 
#define PMM_INVALID_PHYS   UINT64_MAX
 
#define AuPmmngrAllocPage(type)   ((uint64_t)AuPmmngrAlloc())
 
#define AuPmmngrAllocPages(pages, alignment, ceiling, type)    ((uint64_t)AuPmmngrAllocBlocks((int)(pages)))
 
#define AuPmmngrReleasePage(physaddr)    (AuPmmngrFree((void*)(uint64_t)(physaddr)), true)
 

Typedefs

typedef struct _au_pmm_stats_ AuPmmStats
 
typedef struct _au_page_desc_ AuPageDesc
 

Functions

void AuPmmngrInitialize (KERNEL_BOOT_INFO *info)
 
AU_EXTERN AU_EXPORT void * AuPmmngrAlloc ()
 
AU_EXTERN AU_EXPORT void * AuPmmngrAllocBlocks (int num)
 
AU_EXTERN AU_EXPORT void AuPmmngrFree (void *Address)
 
AU_EXTERN AU_EXPORT void AuPmmngrFreeBlocks (void *Addr, int Count)
 
uint64_t AuPmmngrGetFreeMem ()
 
uint64_t AuPmmngrGetUsedMem ()
 
uint64_t AuPmmngrGetTotalMem ()
 
void AuPmmngrAddRefcount (uint64_t physaddr, uint16_t count)
 
uint16_t AuPmmngrGetRefcount (uint64_t physaddr)
 
AuPageDescAuPmmngrGetPageDesc (uint64_t physaddr)
 
void AuPmmngrSetPageType (uint64_t physaddr, uint8_t flags)
 
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.
 

Detailed Description

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:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

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.

Macro Definition Documentation

◆ AuPmmngrAllocPage

#define AuPmmngrAllocPage (   type)    ((uint64_t)AuPmmngrAlloc())

◆ AuPmmngrAllocPages

#define AuPmmngrAllocPages (   pages,
  alignment,
  ceiling,
  type 
)     ((uint64_t)AuPmmngrAllocBlocks((int)(pages)))

◆ AuPmmngrReleasePage

#define AuPmmngrReleasePage (   physaddr)     (AuPmmngrFree((void*)(uint64_t)(physaddr)), true)

◆ AURORA_PAGE_DMA

#define AURORA_PAGE_DMA   (1ULL<<2)

◆ AURORA_PAGE_KERNEL

#define AURORA_PAGE_KERNEL   (1ULL<<0)

◆ AURORA_PAGE_NORMAL

#define AURORA_PAGE_NORMAL   (1ULL << 3)

◆ AURORA_PAGE_SHM

#define AURORA_PAGE_SHM   (1ULL<<1)

◆ PMM_INVALID_PHYS

#define PMM_INVALID_PHYS   UINT64_MAX

Typedef Documentation

◆ AuPageDesc

typedef struct _au_page_desc_ AuPageDesc

◆ AuPmmStats

typedef struct _au_pmm_stats_ AuPmmStats

Function Documentation

◆ AuPmmngrAddRefcount()

void AuPmmngrAddRefcount ( uint64_t  physaddr,
uint16_t  count 
)
extern

◆ AuPmmngrAlloc()

AU_EXTERN AU_EXPORT void * AuPmmngrAlloc ( )

◆ AuPmmngrAllocBlocks()

AU_EXTERN AU_EXPORT void * AuPmmngrAllocBlocks ( int  num)

◆ AuPmmngrFree()

AU_EXTERN AU_EXPORT void AuPmmngrFree ( void *  Address)

◆ AuPmmngrFreeBlocks()

AU_EXTERN AU_EXPORT void AuPmmngrFreeBlocks ( void *  Addr,
int  Count 
)

◆ AuPmmngrGetFreeMem()

uint64_t AuPmmngrGetFreeMem ( )
extern

◆ AuPmmngrGetPageDesc()

AuPageDesc * AuPmmngrGetPageDesc ( uint64_t  physaddr)
extern

◆ AuPmmngrGetRefcount()

uint16_t AuPmmngrGetRefcount ( uint64_t  physaddr)
extern

◆ AuPmmngrGetTotalMem()

uint64_t AuPmmngrGetTotalMem ( )
extern

◆ AuPmmngrGetUsedMem()

uint64_t AuPmmngrGetUsedMem ( )
extern

◆ AuPmmngrInitialize()

void AuPmmngrInitialize ( KERNEL_BOOT_INFO info)
extern

◆ AuPmmngrMoveHigher()

void AuPmmngrMoveHigher ( )
extern

AuPmmngrMoveHigher – moves the kernel to higher half of memory.

◆ AuPmmngrSetPageType()

void AuPmmngrSetPageType ( uint64_t  physaddr,
uint8_t  flags 
)
extern

◆ P2V()

P2V – Physical to Virtual conversion.

Parameters
addr– Address to convert

◆ V2P()

V2P – Virtual to Physical conversion.

Parameters
vaddr– Address to convert