101#define SPACE_TLB_SHOOTDOWN_TIMEOUT (CLOCKS_PER_SEC)
#define CPU_MAX
Maximum number of CPUs supported.
static uintptr_t address
Mapped virtual address of the HPET registers.
uintptr_t phys_addr_t
Physical address type.
uint8_t pml_callback_id_t
Callback ID type.
#define PML_MAX_CALLBACK
Maximum number of callbacks that can be registered for a page table.
uint64_t space_pin_terminated(space_t *space, const void *address, const void *terminator, size_t objectSize, size_t maxCount, stack_pointer_t *userStack)
Pins a region of memory terminated by a terminator value.
void * space_mapping_end(space_t *space, space_mapping_t *mapping, errno_t err)
Performs cleanup after changes to the address space mappings.
bool space_is_mapped(space_t *space, const void *virtAddr, size_t length)
Checks if a virtual memory region is fully mapped.
void space_unpin(space_t *space, const void *address, size_t length)
Unpins pages in a region previously pinned with space_pin() or space_pin_string().
void space_free_callback(space_t *space, pml_callback_id_t callbackId)
Free a callback.
uint64_t space_mapping_start(space_t *space, space_mapping_t *mapping, void *virtAddr, phys_addr_t physAddr, size_t length, size_t alignment, pml_flags_t flags)
Prepare for changes to the address space mappings.
void(* space_callback_func_t)(void *data)
Space callback function.
space_flags_t
Flags for space initialization.
pml_callback_id_t space_alloc_callback(space_t *space, size_t pageAmount, space_callback_func_t func, void *data)
Allocate a callback.
uint64_t space_user_page_count(space_t *space)
Get the number of user pages allocated in the address space.
phys_addr_t space_virt_to_phys(space_t *space, const void *virtAddr)
Translate a virtual address to a physical address in the address space.
uint64_t space_pin(space_t *space, const void *address, size_t length, stack_pointer_t *userStack)
Pins pages within a region of the address space.
uint64_t space_check_access(space_t *space, const void *addr, size_t length)
Checks if a virtual memory region is within the allowed address range of the space.
void space_deinit(space_t *space)
Deinitializes a virtual address space.
uint64_t space_init(space_t *space, uintptr_t startAddress, uintptr_t endAddress, space_flags_t flags)
Initializes a virtual address space.
@ SPACE_MAP_KERNEL_HEAP
Map the kernel heap into the address space.
@ SPACE_MAP_IDENTITY
Map the identity mapped physical memory into the address space.
@ SPACE_MAP_KERNEL_BINARY
Map the kernel binary into the address space.
static const path_flag_t flags[]
__UINTPTR_TYPE__ uintptr_t
A simple ticket lock implementation.
A entry in a page table without a specified address or callback ID.
space_callback_func_t func
Helper structure for managing address space mappings.
uint64_t pinCount
The number of times this page is pinned, will be unpinned when it reaches 0.
Virtual address space structure.
BITMAP_DEFINE(callbackBitmap, PML_MAX_CALLBACK)
Bitmap to track available callback IDs.
map_t pinnedPages
Map of pages with a pin depth greater than 1.
uintptr_t startAddress
The start address for allocations in this address space.
uint64_t callbacksLength
Length of the callbacks array.
uintptr_t endAddress
The end address for allocations in this address space.
BITMAP_DEFINE(cpus, CPU_MAX)
Bitmap to track which CPUs are using this space.
page_table_t pageTable
The page table associated with the address space.
uintptr_t freeAddress
The next available free virtual address in this address space.
atomic_uint16_t shootdownAcks
space_callback_t * callbacks
Structure to define a stack in memory.