Error Handling & Global Variables
Error Handling
The Styx API uses the vmxroot_error_t
enumeration for error codes. Here are some common error codes defined as macros:
STY_SUCCESS
STY_PML4E_NOT_PRESENT
STY_PDPTE_NOT_PRESENT
STY_PDE_NOT_PRESENT
STY_PTE_NOT_PRESENT
STY_TRANSLATE_FAILURE
STY_INVALID_SELF_REF_PML4E
STY_INVALID_MAPPING_PML4E
STY_INVALID_HOST_VIRTUAL
STY_INVALID_GUEST_PHYSICAL
STY_INVALID_GUEST_VIRTUAL
STY_PAGE_TABLE_INIT_FAILED
These error codes can be used to handle specific error conditions in your code. For example:
Global Variables
pmem_ranges
A map of physical memory ranges.
Type: std::map<std::uintptr_t, std::uintptr_t>
Description: This map contains information about the physical memory ranges available in the system. The key represents the start address of a range, and the value represents the size of the range.
Example:
This global variable can be useful for:
Iterating through available physical memory ranges
Checking if a physical address falls within a valid range
Determining the total amount of physical memory available
Last updated