The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
region.c File Reference
#include "region.h"
#include "kernel/panic.h"
#include "common/stdio.h"

Functions

void region_reserve (phys_addr_t start, phys_addr_t end, const char *label)
 reserve a memory region by recording it in the global table.
bool region_is_reserved (phys_addr_t address)
 check whether a single address falls inside any reserved region.
bool region_overlaps (phys_addr_t start, phys_addr_t end)
 check whether a range overlaps any reserved region.
uint32_t region_count (void)
 return the number of currently reserved regions.
void region_print_all (void)
 print all reserved regions to the console.

Function Documentation

◆ region_reserve()

void region_reserve ( phys_addr_t start,
phys_addr_t end,
const char * label )

reserve a memory region by recording it in the global table.

panics if the table is full.

Parameters
startfirst byte of the region (inclusive).
endfirst byte past the region (exclusive).
labelhuman-readable name for debug output.

◆ region_is_reserved()

bool region_is_reserved ( phys_addr_t address)

check whether a single address falls inside any reserved region.

Parameters
addressthe physical address to test.
Returns
true if the address is reserved, false otherwise.

◆ region_overlaps()

bool region_overlaps ( phys_addr_t start,
phys_addr_t end )

check whether a range overlaps any reserved region.

Parameters
startfirst byte of the range (inclusive).
endfirst byte past the range (exclusive).
Returns
true if any overlap exists, false otherwise.

◆ region_count()

uint32_t region_count ( void )

return the number of currently reserved regions.

◆ region_print_all()

void region_print_all ( void )

print all reserved regions to the console.