Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
phys_base_allocator.h File Reference
#include <libk/stivale2.h>
#include <type.h>

Go to the source code of this file.

Data Structures

struct  memory_region
 

Macros

#define BLOCK_SIZE   (uint64_t) 0x1000
 

Enumerations

enum  MEMORY_ENTRY_TYPE { RESERVED , USABLE }
 

Functions

void phys_base_allocator_install (struct stivale2_struct_tag_memmap *stivale_memmap)
 
void * phys_base_alloc (uint64_t size)
 
void * phys_base_alloc_aligned (uint64_t block, uint64_t align)
 
void vxPhysBaseFree (void *page, uint64_t length)
 
void pmm_log_usage ()
 
uint64_t pys_base_get_free_block_count ()
 
void * phys_base_alloc_on_top (uint64_t block)
 

Variables

uint64_t bitmap_size_
 

Macro Definition Documentation

◆ BLOCK_SIZE

Enumeration Type Documentation

◆ MEMORY_ENTRY_TYPE

Enumerator
RESERVED 
USABLE 

Definition at line 9 of file phys_base_allocator.h.

Function Documentation

◆ phys_base_alloc()

◆ phys_base_alloc_aligned()

void * phys_base_alloc_aligned ( uint64_t block,
uint64_t align )

References bitmap_size_, length, and page.

◆ phys_base_alloc_on_top()

void * phys_base_alloc_on_top ( uint64_t block)

Definition at line 243 of file phys_base_allocator.c.

References NULL.

◆ phys_base_allocator_install()

void phys_base_allocator_install ( struct stivale2_struct_tag_memmap * stivale_memmap)

References size.

◆ pmm_log_usage()

void pmm_log_usage ( )

◆ pys_base_get_free_block_count()

uint64_t pys_base_get_free_block_count ( )

Definition at line 250 of file phys_base_allocator.c.

References bitmap_base_, BLOCK_SIZE, count, and higher_base_length_.

Referenced by pmm_log_usage().

◆ vxPhysBaseFree()

void vxPhysBaseFree ( void * page,
uint64_t length )

Definition at line 263 of file phys_base_allocator.c.

References bitmap_base_, BLOCK_SIZE, pmm_lock, ptr, size, spin_acquire(), and spin_release().

Referenced by slab_cache_destroy().

Variable Documentation

◆ bitmap_size_

uint64_t bitmap_size_
extern

Referenced by phys_base_alloc_aligned().