std1.0.0-beta-7 SafeC docs

std :: kernel::paging

Struct std::PageTable

#include <std/kernel/paging.h> source

struct PageTable {
    struct PageEntry entries[PAGE_TABLE_SIZE];
}

Fields

Methods

§void init()source · definition

Initialize all entries to zero.

§void map(int idx, unsigned long phys_addr, unsigned int flags)source · definition

Map entry at idx to phys_addr with flags.

§void unmap(int idx)source · definition

Unmap entry at idx.

§int is_present(int idx) constsource · definition

Check if entry at idx is present. Returns 1 if present.

§unsigned long get_phys(int idx) constsource · definition

Get physical address from entry at idx. Returns 0 if not present.

§unsigned int get_flags(int idx) constsource · definition

Get flags from entry at idx.

§void set_flags(int idx, unsigned int flags)source · definition

Set flags on existing mapping (preserves physical address).