ArvernOS
Loading...
Searching...
No Matches
frame.h File Reference
#include <core/multiboot.h>
#include <mmu/bitmap.h>
#include <sys/types.h>
Include dependency graph for frame.h:
This graph shows which files directly or indirectly include this file:

Macros

#define PAGE_SIZE   4096
 The default page size.
 

Functions

void frame_init ()
 
opt_uint64_t frame_allocate ()
 
void frame_deallocate (frame_number_t frame_number)
 
frame_number_t frame_containing_address (uint64_t physical_address)
 
uint64_t frame_start_address (frame_number_t frame_number)
 
uint64_t frame_get_used_count ()
 
uint64_t frame_get_max_count ()
 

Function Documentation

◆ frame_allocate()

opt_uint64_t frame_allocate ( )

Allocates a frame and returns its physical address.

Returns
a physical address (frame) (optional)

◆ frame_containing_address()

frame_number_t frame_containing_address ( uint64_t physical_address)

Returns the frame number given a physical address.

Parameters
physical_addressa physical address (frame)
Returns
a frame number

◆ frame_deallocate()

void frame_deallocate ( frame_number_t frame_number)

Deallocates (free) a frame.

Parameters
frame_numbera frame number (not an address)

◆ frame_get_max_count()

uint64_t frame_get_max_count ( )

Returns the number of frames that the system can possibly allocate.

Returns
the maximum number of frames

◆ frame_get_used_count()

uint64_t frame_get_used_count ( )

Returns the number of frames currently used.

Returns
the number of frames currently used

◆ frame_init()

void frame_init ( )

Initializes the frame allocator (physical memory management).

◆ frame_start_address()

uint64_t frame_start_address ( frame_number_t frame_number)

Returns the physical start address of a frame.

Parameters
frame_numbera frame number (not an address)
Returns
a physical address (frame)