XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions
pmmngr.c File Reference
#include <Mm/pmmngr.h>
#include <Mm/vmmngr.h>
#include <Hal/AA64/aa64lowlevel.h>
#include <Sync/spinlock.h>
#include <efi.h>
#include <aucon.h>
#include <string.h>
#include <stdint.h>
#include <_null.h>
Include dependency graph for pmmngr.c:

Classes

struct  PmmPageDesc
 
struct  PmmRange
 
struct  LBMemoryRegion
 

Macros

#define PAGE_SHIFT   12
 
#define PAGE_SIZE   (1ULL << PAGE_SHIFT)
 
#define PMM_MAX_ORDER   32
 
#define PMM_MAX_REGIONS   128
 
#define PMM_MAX_RESERVATIONS   1024
 
#define PMM_NO_PAGE   UINT64_MAX
 

Typedefs

typedef struct PmmPageDesc PmmPageDesc
 
typedef struct PmmRange PmmRange
 
typedef struct LBMemoryRegion LBMemoryRegion
 

Enumerations

enum  PmmPageState {
  PMM_PAGE_UNMANAGED , PMM_PAGE_RESERVED , PMM_PAGE_FREE_HEAD , PMM_PAGE_FREE_TAIL ,
  PMM_PAGE_ALLOC_HEAD , PMM_PAGE_ALLOC_TAIL
}
 

Functions

bool AuPmmngrValidate (void)
 
void AuPmmngrInitialize (KERNEL_BOOT_INFO *info)
 
uint64_t AuPmmngrAllocPages (uint32_t pages, uint32_t alignment, uint64_t ceiling, uint8_t type)
 
uint64_t AuPmmngrAllocPage (uint8_t type)
 
bool AuPmmngrReleasePage (uint64_t phys)
 
bool AuPmmngrReleasePages (uint64_t phys)
 
bool AuPmmngrRetainPage (uint64_t phys)
 
uint16_t AuPmmngrPageRefcount (uint64_t phys)
 
bool AuPmmngrSetBackingBlock (uint64_t phys, int64_t block)
 
int64_t AuPmmngrGetBackingBlock (uint64_t phys)
 
void AuPmmngrGetStats (AuPmmStats *stats)
 
bool AuPmmngrAllocCheck (uint64_t address)
 
uint64_t P2V (uint64_t addr)
 P2V – Physical to Virtual conversion.
 
uint64_t V2P (uint64_t addr)
 V2P – Virtual to Physical conversion.
 
void AuPmmngrMoveHigher (void)
 AuPmmngrMoveHigher – moves the kernel to higher half of memory.
 
void AuPmmngrDebugInfo (void)
 

Macro Definition Documentation

◆ PAGE_SHIFT

#define PAGE_SHIFT   12

ARM64 region-aware buddy physical-memory manager.

◆ PAGE_SIZE

#define PAGE_SIZE   (1ULL << PAGE_SHIFT)

◆ PMM_MAX_ORDER

#define PMM_MAX_ORDER   32

◆ PMM_MAX_REGIONS

#define PMM_MAX_REGIONS   128

◆ PMM_MAX_RESERVATIONS

#define PMM_MAX_RESERVATIONS   1024

◆ PMM_NO_PAGE

#define PMM_NO_PAGE   UINT64_MAX

Typedef Documentation

◆ LBMemoryRegion

◆ PmmPageDesc

typedef struct PmmPageDesc PmmPageDesc

◆ PmmRange

typedef struct PmmRange PmmRange

Enumeration Type Documentation

◆ PmmPageState

Enumerator
PMM_PAGE_UNMANAGED 
PMM_PAGE_RESERVED 
PMM_PAGE_FREE_HEAD 
PMM_PAGE_FREE_TAIL 
PMM_PAGE_ALLOC_HEAD 
PMM_PAGE_ALLOC_TAIL 

Function Documentation

◆ AuPmmngrAllocCheck()

bool AuPmmngrAllocCheck ( uint64_t  address)

◆ AuPmmngrAllocPage()

uint64_t AuPmmngrAllocPage ( uint8_t  type)

◆ AuPmmngrAllocPages()

uint64_t AuPmmngrAllocPages ( uint32_t  pages,
uint32_t  alignment,
uint64_t  ceiling,
uint8_t  type 
)

◆ AuPmmngrDebugInfo()

void AuPmmngrDebugInfo ( void  )

◆ AuPmmngrGetBackingBlock()

int64_t AuPmmngrGetBackingBlock ( uint64_t  phys)

◆ AuPmmngrGetStats()

void AuPmmngrGetStats ( AuPmmStats stats)

◆ AuPmmngrInitialize()

void AuPmmngrInitialize ( KERNEL_BOOT_INFO info)

◆ AuPmmngrMoveHigher()

void AuPmmngrMoveHigher ( void  )

AuPmmngrMoveHigher – moves the kernel to higher half of memory.

◆ AuPmmngrPageRefcount()

uint16_t AuPmmngrPageRefcount ( uint64_t  phys)

◆ AuPmmngrReleasePage()

bool AuPmmngrReleasePage ( uint64_t  phys)

◆ AuPmmngrReleasePages()

bool AuPmmngrReleasePages ( uint64_t  phys)

◆ AuPmmngrRetainPage()

bool AuPmmngrRetainPage ( uint64_t  phys)

◆ AuPmmngrSetBackingBlock()

bool AuPmmngrSetBackingBlock ( uint64_t  phys,
int64_t  block 
)

◆ AuPmmngrValidate()

bool AuPmmngrValidate ( void  )

◆ P2V()

uint64_t P2V ( uint64_t  addr)

P2V – Physical to Virtual conversion.

Parameters
addr– Address to convert

◆ V2P()

uint64_t V2P ( uint64_t  vaddr)

V2P – Virtual to Physical conversion.

Parameters
vaddr– Address to convert