mirror of
https://github.com/Bareflank/hypervisor
synced 2026-08-17 06:23:04 -04:00
Adds an example extension written in Rust and fixes a number of bugs
This patch: - Adds a complete extension written in Rust, with all of the build system logic to support Rust development as well. - Fixes an issues on Intel systems where the MSR bitmaps were not set up properly. - Fixes a number of issues with UEFI. - Fixes a number of issues with Windows, including a BSOD issue with narrow contracts.
This commit is contained in:
parent
44e6f4f19f
commit
91886c75d9
118 changed files with 6021 additions and 9252 deletions
|
|
@ -19,8 +19,104 @@
|
|||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
if(CMAKE_PROJECT_NAME STREQUAL "hypervisor_microkernel")
|
||||
include(mk_lib.cmake)
|
||||
else()
|
||||
include(ext_lib_cpp.cmake)
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL "hypervisor")
|
||||
if(CMAKE_PROJECT_NAME STREQUAL "hypervisor_microkernel")
|
||||
include(mk_lib.cmake)
|
||||
else()
|
||||
include(ext_lib_cpp.cmake)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_PROJECT_NAME STREQUAL "hypervisor" AND NOT EXISTS ${CMAKE_BINARY_DIR}/rust/syscall_rust_files.txt)
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Rebuild Flag
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/rust)
|
||||
set(HYPERVISOR_CONSTANTS ${CMAKE_BINARY_DIR}/rust/syscall_rust_files.txt)
|
||||
|
||||
file(WRITE ${HYPERVISOR_CONSTANTS} "touched\n")
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Cargo.toml
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
set(HYPERVISOR_CARGO_TOML ${CMAKE_SOURCE_DIR}/syscall/Cargo.toml)
|
||||
|
||||
file(WRITE ${HYPERVISOR_CARGO_TOML} "[package]\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "name = \"syscall\"\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "version = \"0.1.0\"\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "edition = \"2018\"\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "[lib]\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "path = \"lib.rs\"\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "[features]\n")
|
||||
|
||||
set(SYSCALL_DEFAULT_FEATURES "[\"custom_print_thread_id\"")
|
||||
|
||||
if(HYPERVISOR_TARGET_ARCH STREQUAL "AuthenticAMD")
|
||||
set(SYSCALL_DEFAULT_FEATURES "${SYSCALL_DEFAULT_FEATURES},\"AuthenticAMD\"")
|
||||
endif()
|
||||
|
||||
if(HYPERVISOR_TARGET_ARCH STREQUAL "GenuineIntel")
|
||||
set(SYSCALL_DEFAULT_FEATURES "${SYSCALL_DEFAULT_FEATURES},\"GenuineIntel\"")
|
||||
endif()
|
||||
|
||||
if(NOT ENABLE_COLOR)
|
||||
set(SYSCALL_DEFAULT_FEATURES "${SYSCALL_DEFAULT_FEATURES},\"disable_color\"")
|
||||
endif()
|
||||
|
||||
if(BSL_DEBUG_LEVEL STREQUAL "bsl::V")
|
||||
set(SYSCALL_DEFAULT_FEATURES "${SYSCALL_DEFAULT_FEATURES},\"debug_level_v\"")
|
||||
endif()
|
||||
|
||||
if(BSL_DEBUG_LEVEL STREQUAL "bsl::VV")
|
||||
set(SYSCALL_DEFAULT_FEATURES "${SYSCALL_DEFAULT_FEATURES},\"debug_level_v\",\"debug_level_vv\"")
|
||||
endif()
|
||||
|
||||
if(BSL_DEBUG_LEVEL STREQUAL "bsl::VVV")
|
||||
set(SYSCALL_DEFAULT_FEATURES "${SYSCALL_DEFAULT_FEATURES},\"debug_level_v\",\"debug_level_vv\",\"debug_level_vvv\"")
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL RELEASE OR CMAKE_BUILD_TYPE STREQUAL MINSIZEREL)
|
||||
set(SYSCALL_DEFAULT_FEATURES "${SYSCALL_DEFAULT_FEATURES},\"release_mode\"]")
|
||||
else()
|
||||
set(SYSCALL_DEFAULT_FEATURES "${SYSCALL_DEFAULT_FEATURES}]")
|
||||
endif()
|
||||
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "default = ${SYSCALL_DEFAULT_FEATURES}\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "debug_level_v = []\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "debug_level_vv = []\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "debug_level_vvv = []\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "disable_color = []\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "release_mode = []\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "AuthenticAMD = []\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "GenuineIntel = []\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "custom_print_thread_id = []\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "\n")
|
||||
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "[dependencies]\n")
|
||||
file(APPEND ${HYPERVISOR_CARGO_TOML} "bsl = { path = \"${bsl_SOURCE_DIR}\" }\n")
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Constants
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
set(HYPERVISOR_CONSTANTS ${CMAKE_SOURCE_DIR}/syscall/constants.rs)
|
||||
|
||||
file(WRITE ${HYPERVISOR_CONSTANTS} "\n")
|
||||
file(APPEND ${HYPERVISOR_CONSTANTS} "pub const HYPERVISOR_PAGE_SIZE:bsl::SafeU64 = bsl::SafeU64::new(${HYPERVISOR_PAGE_SIZE});\n")
|
||||
file(APPEND ${HYPERVISOR_CONSTANTS} "pub const HYPERVISOR_PAGE_SHIFT:bsl::SafeU64 = bsl::SafeU64::new(${HYPERVISOR_PAGE_SHIFT});\n")
|
||||
file(APPEND ${HYPERVISOR_CONSTANTS} "pub const HYPERVISOR_MAX_PPS:bsl::SafeUMx = bsl::SafeUMx::new(${HYPERVISOR_MAX_PPS});\n")
|
||||
file(APPEND ${HYPERVISOR_CONSTANTS} "pub const HYPERVISOR_MAX_VMS:bsl::SafeUMx = bsl::SafeUMx::new(${HYPERVISOR_MAX_VMS});\n")
|
||||
file(APPEND ${HYPERVISOR_CONSTANTS} "pub const HYPERVISOR_MAX_VPS:bsl::SafeUMx = bsl::SafeUMx::new(${HYPERVISOR_MAX_VPS});\n")
|
||||
file(APPEND ${HYPERVISOR_CONSTANTS} "pub const HYPERVISOR_MAX_VSS:bsl::SafeUMx = bsl::SafeUMx::new(${HYPERVISOR_MAX_VSS});\n")
|
||||
file(APPEND ${HYPERVISOR_CONSTANTS} "pub const HYPERVISOR_EXT_DIRECT_MAP_ADDR:bsl::SafeU64 = bsl::SafeU64::new(${HYPERVISOR_EXT_DIRECT_MAP_ADDR});\n")
|
||||
file(APPEND ${HYPERVISOR_CONSTANTS} "pub const HYPERVISOR_EXT_DIRECT_MAP_SIZE:bsl::SafeU64 = bsl::SafeU64::new(${HYPERVISOR_EXT_DIRECT_MAP_SIZE});\n")
|
||||
file(APPEND ${HYPERVISOR_CONSTANTS} "pub const HYPERVISOR_EXT_PAGE_POOL_ADDR:bsl::SafeU64 = bsl::SafeU64::new(${HYPERVISOR_EXT_PAGE_POOL_ADDR});\n")
|
||||
file(APPEND ${HYPERVISOR_CONSTANTS} "pub const HYPERVISOR_EXT_PAGE_POOL_SIZE:bsl::SafeU64 = bsl::SafeU64::new(${HYPERVISOR_EXT_PAGE_POOL_SIZE});\n")
|
||||
file(APPEND ${HYPERVISOR_CONSTANTS} "pub const HYPERVISOR_EXT_HUGE_POOL_ADDR:bsl::SafeU64 = bsl::SafeU64::new(${HYPERVISOR_EXT_HUGE_POOL_ADDR});\n")
|
||||
file(APPEND ${HYPERVISOR_CONSTANTS} "pub const HYPERVISOR_EXT_HUGE_POOL_SIZE:bsl::SafeU64 = bsl::SafeU64::new(${HYPERVISOR_EXT_HUGE_POOL_SIZE});\n")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
[package]
|
||||
name = "syscall"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
|
|
@ -73,8 +73,6 @@ namespace syscall
|
|||
|
||||
/// @brief Defines an invalid ID for an extension, VM, VP and VS
|
||||
constexpr auto BF_INVALID_ID{0xFFFF_u16};
|
||||
/// @brief Defines an ID for any extension, VM, VP and VS
|
||||
constexpr auto BF_ANY_ID{0xFFFE_u16};
|
||||
|
||||
/// @brief Defines the bootstrap physical processor ID
|
||||
constexpr auto BF_BS_PPID{0x0_u16};
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@
|
|||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
/// SOFTWARE.
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Page Alignment
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Returns true if the provided address is 4k page aligned,
|
||||
|
|
@ -35,16 +35,16 @@
|
|||
/// @return Returns true if the provided address is 4k page aligned,
|
||||
/// returns false otherwise.
|
||||
///
|
||||
pub fn bf_is_page_aligned(addr: u64) -> bool {
|
||||
const MASK: u64 = cmake::HYPERVISOR_PAGE_SIZE - 1;
|
||||
return (addr & MASK) == 0;
|
||||
pub fn bf_is_page_aligned(addr: bsl::SafeU64) -> bool {
|
||||
let mask: bsl::SafeU64 = crate::HYPERVISOR_PAGE_SIZE - 1;
|
||||
return (addr & mask) == 0;
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_bf_is_page_aligned {
|
||||
#[test]
|
||||
fn test_bf_is_page_aligned() {
|
||||
let addr: u64 = 0x1234567890ABCDEF;
|
||||
let addr: bsl::SafeU64 = bsl::SafeU64::new(0x1234567890ABCDEF);
|
||||
assert!(!super::bf_is_page_aligned(addr));
|
||||
}
|
||||
}
|
||||
|
|
@ -56,88 +56,88 @@ mod test_bf_is_page_aligned {
|
|||
/// @param addr the address to query
|
||||
/// @return Returns the page aligned version of the addr
|
||||
///
|
||||
pub fn bf_page_aligned(addr: u64) -> u64 {
|
||||
return addr & !(cmake::HYPERVISOR_PAGE_SIZE - 1);
|
||||
pub fn bf_page_aligned(addr: bsl::SafeU64) -> bsl::SafeU64 {
|
||||
return addr & !(crate::HYPERVISOR_PAGE_SIZE - 1);
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_bf_page_aligned {
|
||||
#[test]
|
||||
fn test_bf_page_aligned() {
|
||||
let addr: u64 = 0x1234567890ABCDEF;
|
||||
let expected: u64 = 0x1234567890ABC000;
|
||||
let addr: bsl::SafeU64 = bsl::SafeU64::new(0x1234567890ABCDEF);
|
||||
let expected: bsl::SafeU64 = bsl::SafeU64::new(0x1234567890ABC000);
|
||||
assert_eq!(super::bf_page_aligned(addr), expected);
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Special IDs
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief Defines an invalid ID for an extension, VM, VP and VS
|
||||
pub const BF_INVALID_ID: u16 = 0xFFFF;
|
||||
pub const BF_INVALID_ID: bsl::SafeU16 = bsl::SafeU16::new(0xFFFF);
|
||||
|
||||
/// @brief Defines the bootstrap physical processor ID
|
||||
pub const BF_BS_PPID: u16 = 0x0;
|
||||
pub const BF_BS_PPID: bsl::SafeU16 = bsl::SafeU16::new(0x0);
|
||||
|
||||
/// @brief Defines the root virtual machine ID
|
||||
pub const BF_ROOT_VMID: u16 = 0x0;
|
||||
pub const BF_ROOT_VMID: bsl::SafeU16 = bsl::SafeU16::new(0x0);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Syscall Status Codes
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief Indicates the syscall returned successfully
|
||||
pub const BF_STATUS_SUCCESS: u64 = 0x0000000000000000;
|
||||
pub const BF_STATUS_SUCCESS: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000000);
|
||||
/// @brief Indicates an unknown error occurred
|
||||
pub const BF_STATUS_FAILURE_UNKNOWN: u64 = 0xDEAD000000010001;
|
||||
pub const BF_STATUS_FAILURE_UNKNOWN: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000000010001);
|
||||
/// @brief Indicates the syscall is unsupported
|
||||
pub const BF_STATUS_FAILURE_INVALID_HANDLE: u64 = 0xDEAD000000020001;
|
||||
pub const BF_STATUS_FAILURE_INVALID_HANDLE: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000000020001);
|
||||
/// @brief Indicates the provided handle is invalid
|
||||
pub const BF_STATUS_FAILURE_UNSUPPORTED: u64 = 0xDEAD000000040001;
|
||||
pub const BF_STATUS_FAILURE_UNSUPPORTED: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000000040001);
|
||||
/// @brief Indicates the policy engine denied the syscall
|
||||
pub const BF_STATUS_INVALID_PERM_DENIED: u64 = 0xDEAD000000010002;
|
||||
pub const BF_STATUS_INVALID_PERM_DENIED: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000000010002);
|
||||
/// @brief Indicates input reg0 is invalid
|
||||
pub const BF_STATUS_INVALID_INPUT_REG0: u64 = 0xDEAD000000010003;
|
||||
pub const BF_STATUS_INVALID_INPUT_REG0: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000000010003);
|
||||
/// @brief Indicates input reg1 is invalid
|
||||
pub const BF_STATUS_INVALID_INPUT_REG1: u64 = 0xDEAD000000020003;
|
||||
pub const BF_STATUS_INVALID_INPUT_REG1: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000000020003);
|
||||
/// @brief Indicates input reg2 is invalid
|
||||
pub const BF_STATUS_INVALID_INPUT_REG2: u64 = 0xDEAD000000040003;
|
||||
pub const BF_STATUS_INVALID_INPUT_REG2: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000000040003);
|
||||
/// @brief Indicates input reg3 is invalid
|
||||
pub const BF_STATUS_INVALID_INPUT_REG3: u64 = 0xDEAD000000080003;
|
||||
pub const BF_STATUS_INVALID_INPUT_REG3: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000000080003);
|
||||
/// @brief Indicates input reg4 is invalid
|
||||
pub const BF_STATUS_INVALID_INPUT_REG4: u64 = 0xDEAD000000100003;
|
||||
pub const BF_STATUS_INVALID_INPUT_REG4: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000000100003);
|
||||
/// @brief Indicates input reg5 is invalid
|
||||
pub const BF_STATUS_INVALID_INPUT_REG5: u64 = 0xDEAD000000200003;
|
||||
pub const BF_STATUS_INVALID_INPUT_REG5: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000000200003);
|
||||
/// @brief Indicates output reg0 is invalid
|
||||
pub const BF_STATUS_INVALID_OUTPUT_REG0: u64 = 0xDEAD000000400003;
|
||||
pub const BF_STATUS_INVALID_OUTPUT_REG0: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000000400003);
|
||||
/// @brief Indicates output reg1 is invalid
|
||||
pub const BF_STATUS_INVALID_OUTPUT_REG1: u64 = 0xDEAD000000800003;
|
||||
pub const BF_STATUS_INVALID_OUTPUT_REG1: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000000800003);
|
||||
/// @brief Indicates output reg2 is invalid
|
||||
pub const BF_STATUS_INVALID_OUTPUT_REG2: u64 = 0xDEAD000001000003;
|
||||
pub const BF_STATUS_INVALID_OUTPUT_REG2: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000001000003);
|
||||
/// @brief Indicates output reg3 is invalid
|
||||
pub const BF_STATUS_INVALID_OUTPUT_REG3: u64 = 0xDEAD000002000003;
|
||||
pub const BF_STATUS_INVALID_OUTPUT_REG3: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000002000003);
|
||||
/// @brief Indicates output reg4 is invalid
|
||||
pub const BF_STATUS_INVALID_OUTPUT_REG4: u64 = 0xDEAD000004000003;
|
||||
pub const BF_STATUS_INVALID_OUTPUT_REG4: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000004000003);
|
||||
/// @brief Indicates output reg5 is invalid
|
||||
pub const BF_STATUS_INVALID_OUTPUT_REG5: u64 = 0xDEAD000008000003;
|
||||
pub const BF_STATUS_INVALID_OUTPUT_REG5: bsl::SafeU64 = bsl::SafeU64::new(0xDEAD000008000003);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Syscall Inputs
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief Defines the BF_SYSCALL_SIG field for RAX
|
||||
pub const BF_SYSCALL_SIG_VAL: u64 = 0x6642000000000000;
|
||||
pub const BF_SYSCALL_SIG_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x6642000000000000);
|
||||
/// @brief Defines a mask for BF_SYSCALL_SIG
|
||||
pub const BF_SYSCALL_SIG_MASK: u64 = 0xFFFF000000000000;
|
||||
pub const BF_SYSCALL_SIG_MASK: bsl::SafeU64 = bsl::SafeU64::new(0xFFFF000000000000);
|
||||
/// @brief Defines a mask for BF_SYSCALL_FLAGS
|
||||
pub const BF_SYSCALL_FLAGS_MASK: u64 = 0x0000FFFF00000000;
|
||||
pub const BF_SYSCALL_FLAGS_MASK: bsl::SafeU64 = bsl::SafeU64::new(0x0000FFFF00000000);
|
||||
/// @brief Defines a mask for BF_SYSCALL_OP
|
||||
pub const BF_SYSCALL_OPCODE_MASK: u64 = 0xFFFF0000FFFF0000;
|
||||
pub const BF_SYSCALL_OPCODE_MASK: bsl::SafeU64 = bsl::SafeU64::new(0xFFFF0000FFFF0000);
|
||||
/// @brief Defines a mask for BF_SYSCALL_OP (with no signature added)
|
||||
pub const BF_SYSCALL_OPCODE_NOSIG_MASK: u64 = 0x00000000FFFF0000;
|
||||
pub const BF_SYSCALL_OPCODE_NOSIG_MASK: bsl::SafeU64 = bsl::SafeU64::new(0x00000000FFFF0000);
|
||||
/// @brief Defines a mask for BF_SYSCALL_IDX
|
||||
pub const BF_SYSCALL_INDEX_MASK: u64 = 0x000000000000FFFF;
|
||||
pub const BF_SYSCALL_INDEX_MASK: bsl::SafeU64 = bsl::SafeU64::new(0x000000000000FFFF);
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief n/a
|
||||
|
|
@ -146,7 +146,7 @@ pub const BF_SYSCALL_INDEX_MASK: u64 = 0x000000000000FFFF;
|
|||
/// @param rax n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_syscall_sig(rax: u64) -> u64 {
|
||||
pub fn bf_syscall_sig(rax: bsl::SafeU64) -> bsl::SafeU64 {
|
||||
return rax & BF_SYSCALL_SIG_MASK;
|
||||
}
|
||||
|
||||
|
|
@ -154,8 +154,8 @@ pub fn bf_syscall_sig(rax: u64) -> u64 {
|
|||
mod test_bf_syscall_sig {
|
||||
#[test]
|
||||
fn test_bf_syscall_sig() {
|
||||
let syscall: u64 = 0x1234567890ABCDEF;
|
||||
let expected: u64 = 0x1234000000000000;
|
||||
let syscall: bsl::SafeU64 = bsl::SafeU64::new(0x1234567890ABCDEF);
|
||||
let expected: bsl::SafeU64 = bsl::SafeU64::new(0x1234000000000000);
|
||||
assert_eq!(super::bf_syscall_sig(syscall), expected);
|
||||
}
|
||||
}
|
||||
|
|
@ -167,7 +167,7 @@ mod test_bf_syscall_sig {
|
|||
/// @param rax n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_syscall_flags(rax: u64) -> u64 {
|
||||
pub fn bf_syscall_flags(rax: bsl::SafeU64) -> bsl::SafeU64 {
|
||||
return rax & BF_SYSCALL_FLAGS_MASK;
|
||||
}
|
||||
|
||||
|
|
@ -175,8 +175,8 @@ pub fn bf_syscall_flags(rax: u64) -> u64 {
|
|||
mod test_bf_syscall_flags {
|
||||
#[test]
|
||||
fn test_bf_syscall_flags() {
|
||||
let syscall: u64 = 0x1234567890ABCDEF;
|
||||
let expected: u64 = 0x0000567800000000;
|
||||
let syscall: bsl::SafeU64 = bsl::SafeU64::new(0x1234567890ABCDEF);
|
||||
let expected: bsl::SafeU64 = bsl::SafeU64::new(0x0000567800000000);
|
||||
assert_eq!(super::bf_syscall_flags(syscall), expected);
|
||||
}
|
||||
}
|
||||
|
|
@ -188,7 +188,7 @@ mod test_bf_syscall_flags {
|
|||
/// @param rax n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_syscall_opcode(rax: u64) -> u64 {
|
||||
pub fn bf_syscall_opcode(rax: bsl::SafeU64) -> bsl::SafeU64 {
|
||||
return rax & BF_SYSCALL_OPCODE_MASK;
|
||||
}
|
||||
|
||||
|
|
@ -196,8 +196,8 @@ pub fn bf_syscall_opcode(rax: u64) -> u64 {
|
|||
mod test_bf_syscall_opcode {
|
||||
#[test]
|
||||
fn test_bf_syscall_opcode() {
|
||||
let syscall: u64 = 0x1234567890ABCDEF;
|
||||
let expected: u64 = 0x1234000090AB0000;
|
||||
let syscall: bsl::SafeU64 = bsl::SafeU64::new(0x1234567890ABCDEF);
|
||||
let expected: bsl::SafeU64 = bsl::SafeU64::new(0x1234000090AB0000);
|
||||
assert_eq!(super::bf_syscall_opcode(syscall), expected);
|
||||
}
|
||||
}
|
||||
|
|
@ -209,7 +209,7 @@ mod test_bf_syscall_opcode {
|
|||
/// @param rax n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_syscall_opcode_nosig(rax: u64) -> u64 {
|
||||
pub fn bf_syscall_opcode_nosig(rax: bsl::SafeU64) -> bsl::SafeU64 {
|
||||
return rax & BF_SYSCALL_OPCODE_NOSIG_MASK;
|
||||
}
|
||||
|
||||
|
|
@ -217,8 +217,8 @@ pub fn bf_syscall_opcode_nosig(rax: u64) -> u64 {
|
|||
mod test_bf_syscall_opcode_nosig {
|
||||
#[test]
|
||||
fn test_bf_syscall_opcode_nosig() {
|
||||
let syscall: u64 = 0x1234567890ABCDEF;
|
||||
let expected: u64 = 0x0000000090AB0000;
|
||||
let syscall: bsl::SafeU64 = bsl::SafeU64::new(0x1234567890ABCDEF);
|
||||
let expected: bsl::SafeU64 = bsl::SafeU64::new(0x0000000090AB0000);
|
||||
assert_eq!(super::bf_syscall_opcode_nosig(syscall), expected);
|
||||
}
|
||||
}
|
||||
|
|
@ -230,7 +230,7 @@ mod test_bf_syscall_opcode_nosig {
|
|||
/// @param rax n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_syscall_index(rax: u64) -> u64 {
|
||||
pub fn bf_syscall_index(rax: bsl::SafeU64) -> bsl::SafeU64 {
|
||||
return rax & BF_SYSCALL_INDEX_MASK;
|
||||
}
|
||||
|
||||
|
|
@ -238,27 +238,27 @@ pub fn bf_syscall_index(rax: u64) -> u64 {
|
|||
mod test_bf_syscall_index {
|
||||
#[test]
|
||||
fn test_bf_syscall_index() {
|
||||
let syscall: u64 = 0x1234567890ABCDEF;
|
||||
let expected: u64 = 0x000000000000CDEF;
|
||||
let syscall: bsl::SafeU64 = bsl::SafeU64::new(0x1234567890ABCDEF);
|
||||
let expected: bsl::SafeU64 = bsl::SafeU64::new(0x000000000000CDEF);
|
||||
assert_eq!(super::bf_syscall_index(syscall), expected);
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Specification IDs
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief Defines the ID for version #1 of this spec
|
||||
pub const BF_SPEC_ID1_VAL: u32 = 0x31236642;
|
||||
pub const BF_SPEC_ID1_VAL: bsl::SafeU32 = bsl::SafeU32::new(0x31236642);
|
||||
|
||||
/// @brief Defines the mask for checking support for version #1 of this spec
|
||||
pub const BF_SPEC_ID1_MASK: u32 = 0x2;
|
||||
pub const BF_SPEC_ID1_MASK: bsl::SafeU32 = bsl::SafeU32::new(0x2);
|
||||
|
||||
/// @brief Defines all versions supported
|
||||
pub const BF_ALL_SPECS_SUPPORTED_VAL: u32 = 0x2;
|
||||
pub const BF_ALL_SPECS_SUPPORTED_VAL: bsl::SafeU32 = bsl::SafeU32::new(0x2);
|
||||
|
||||
/// @brief Defines an invalid version
|
||||
pub const BF_INVALID_VERSION: u32 = 0x80000000;
|
||||
pub const BF_INVALID_VERSION: bsl::SafeU32 = bsl::SafeU32::new(0x80000000);
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief n/a
|
||||
|
|
@ -267,7 +267,7 @@ pub const BF_INVALID_VERSION: u32 = 0x80000000;
|
|||
/// @param version n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_is_spec1_supported(version: u32) -> bool {
|
||||
pub fn bf_is_spec1_supported(version: bsl::SafeU32) -> bool {
|
||||
return (version & BF_SPEC_ID1_MASK) != 0;
|
||||
}
|
||||
|
||||
|
|
@ -275,241 +275,253 @@ pub fn bf_is_spec1_supported(version: u32) -> bool {
|
|||
mod test_bf_is_spec1_supported {
|
||||
#[test]
|
||||
fn test_bf_is_spec1_supported() {
|
||||
let ver1: u32 = 0x2;
|
||||
let ver2: u32 = 0x80000000;
|
||||
let ver1: bsl::SafeU32 = 0x2;
|
||||
let ver2: bsl::SafeU32 = 0x80000000;
|
||||
assert!(super::bf_is_spec1_supported(ver1));
|
||||
assert!(!super::bf_is_spec1_supported(ver2));
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Syscall Opcodes - Control Support
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief Defines the syscall opcode for bf_control_op
|
||||
pub const BF_CONTROL_OP_VAL: u64 = 0x6642000000000000;
|
||||
pub const BF_CONTROL_OP_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x6642000000000000);
|
||||
/// @brief Defines the syscall opcode for bf_control_op (nosig)
|
||||
pub const BF_CONTROL_OP_NOSIG_VAL: u64 = 0x0000000000000000;
|
||||
pub const BF_CONTROL_OP_NOSIG_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000000);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Syscall Opcodes - Handle Support
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief Defines the syscall opcode for bf_handle_op
|
||||
pub const BF_HANDLE_OP_VAL: u64 = 0x6642000000010000;
|
||||
pub const BF_HANDLE_OP_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x6642000000010000);
|
||||
/// @brief Defines the syscall opcode for bf_handle_op (nosig)
|
||||
pub const BF_HANDLE_OP_NOSIG_VAL: u64 = 0x0000000000010000;
|
||||
pub const BF_HANDLE_OP_NOSIG_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000010000);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Syscall Opcodes - Debug Support
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief Defines the syscall opcode for bf_debug_op
|
||||
pub const BF_DEBUG_OP_VAL: u64 = 0x6642000000020000;
|
||||
pub const BF_DEBUG_OP_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x6642000000020000);
|
||||
/// @brief Defines the syscall opcode for bf_debug_op (nosig)
|
||||
pub const BF_DEBUG_OP_NOSIG_VAL: u64 = 0x00000000000020000;
|
||||
pub const BF_DEBUG_OP_NOSIG_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x00000000000020000);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Syscall Opcodes - Callback Support
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief Defines the syscall opcode for bf_callback_op
|
||||
pub const BF_CALLBACK_OP_VAL: u64 = 0x6642000000030000;
|
||||
pub const BF_CALLBACK_OP_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x6642000000030000);
|
||||
/// @brief Defines the syscall opcode for bf_callback_op (nosig)
|
||||
pub const BF_CALLBACK_OP_NOSIG_VAL: u64 = 0x0000000000030000;
|
||||
pub const BF_CALLBACK_OP_NOSIG_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000030000);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Syscall Opcodes - VM Support
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief Defines the syscall opcode for bf_vm_op
|
||||
pub const BF_VM_OP_VAL: u64 = 0x6642000000040000;
|
||||
pub const BF_VM_OP_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x6642000000040000);
|
||||
/// @brief Defines the syscall opcode for bf_vm_op (nosig)
|
||||
pub const BF_VM_OP_NOSIG_VAL: u64 = 0x0000000000040000;
|
||||
pub const BF_VM_OP_NOSIG_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000040000);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Syscall Opcodes - VP Support
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief Defines the syscall opcode for bf_vp_op
|
||||
pub const BF_VP_OP_VAL: u64 = 0x6642000000050000;
|
||||
pub const BF_VP_OP_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x6642000000050000);
|
||||
/// @brief Defines the syscall opcode for bf_vp_op (nosig)
|
||||
pub const BF_VP_OP_NOSIG_VAL: u64 = 0x0000000000050000;
|
||||
pub const BF_VP_OP_NOSIG_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000050000);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Syscall Opcodes - VS Support
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief Defines the syscall opcode for bf_vs_op
|
||||
pub const BF_VS_OP_VAL: u64 = 0x6642000000060000;
|
||||
pub const BF_VS_OP_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x6642000000060000);
|
||||
/// @brief Defines the syscall opcode for bf_vs_op (nosig)
|
||||
pub const BF_VS_OP_NOSIG_VAL: u64 = 0x0000000000060000;
|
||||
pub const BF_VS_OP_NOSIG_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000060000);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Syscall Opcodes - Intrinsic Support
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief Defines the syscall opcode for bf_intrinsic_op
|
||||
pub const BF_INTRINSIC_OP_VAL: u64 = 0x6642000000070000;
|
||||
pub const BF_INTRINSIC_OP_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x6642000000070000);
|
||||
/// @brief Defines the syscall opcode for bf_intrinsic_op (nosig)
|
||||
pub const BF_INTRINSIC_OP_NOSIG_VAL: u64 = 0x0000000000070000;
|
||||
pub const BF_INTRINSIC_OP_NOSIG_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000070000);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Syscall Opcodes - Mem Support
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief Defines the syscall opcode for bf_mem_op
|
||||
pub const BF_MEM_OP_VAL: u64 = 0x6642000000080000;
|
||||
pub const BF_MEM_OP_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x6642000000080000);
|
||||
/// @brief Defines the syscall opcode for bf_mem_op (nosig)
|
||||
pub const BF_MEM_OP_NOSIG_VAL: u64 = 0x0000000000080000;
|
||||
pub const BF_MEM_OP_NOSIG_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000080000);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// TLS Offsets
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief stores the offset for rax
|
||||
pub const TLS_OFFSET_RAX: u64 = 0x800;
|
||||
pub const TLS_OFFSET_RAX: bsl::SafeU64 = bsl::SafeU64::new(0x800);
|
||||
/// @brief stores the offset for rbx
|
||||
pub const TLS_OFFSET_RBX: u64 = 0x808;
|
||||
pub const TLS_OFFSET_RBX: bsl::SafeU64 = bsl::SafeU64::new(0x808);
|
||||
/// @brief stores the offset for rcx
|
||||
pub const TLS_OFFSET_RCX: u64 = 0x810;
|
||||
pub const TLS_OFFSET_RCX: bsl::SafeU64 = bsl::SafeU64::new(0x810);
|
||||
/// @brief stores the offset for rdx
|
||||
pub const TLS_OFFSET_RDX: u64 = 0x818;
|
||||
pub const TLS_OFFSET_RDX: bsl::SafeU64 = bsl::SafeU64::new(0x818);
|
||||
/// @brief stores the offset for rbp
|
||||
pub const TLS_OFFSET_RBP: u64 = 0x820;
|
||||
pub const TLS_OFFSET_RBP: bsl::SafeU64 = bsl::SafeU64::new(0x820);
|
||||
/// @brief stores the offset for rsi
|
||||
pub const TLS_OFFSET_RSI: u64 = 0x828;
|
||||
pub const TLS_OFFSET_RSI: bsl::SafeU64 = bsl::SafeU64::new(0x828);
|
||||
/// @brief stores the offset for rdi
|
||||
pub const TLS_OFFSET_RDI: u64 = 0x830;
|
||||
pub const TLS_OFFSET_RDI: bsl::SafeU64 = bsl::SafeU64::new(0x830);
|
||||
/// @brief stores the offset for r8
|
||||
pub const TLS_OFFSET_R8: u64 = 0x838;
|
||||
pub const TLS_OFFSET_R8: bsl::SafeU64 = bsl::SafeU64::new(0x838);
|
||||
/// @brief stores the offset for r9
|
||||
pub const TLS_OFFSET_R9: u64 = 0x840;
|
||||
pub const TLS_OFFSET_R9: bsl::SafeU64 = bsl::SafeU64::new(0x840);
|
||||
/// @brief stores the offset for r10
|
||||
pub const TLS_OFFSET_R10: u64 = 0x848;
|
||||
pub const TLS_OFFSET_R10: bsl::SafeU64 = bsl::SafeU64::new(0x848);
|
||||
/// @brief stores the offset for r11
|
||||
pub const TLS_OFFSET_R11: u64 = 0x850;
|
||||
pub const TLS_OFFSET_R11: bsl::SafeU64 = bsl::SafeU64::new(0x850);
|
||||
/// @brief stores the offset for r12
|
||||
pub const TLS_OFFSET_R12: u64 = 0x858;
|
||||
pub const TLS_OFFSET_R12: bsl::SafeU64 = bsl::SafeU64::new(0x858);
|
||||
/// @brief stores the offset for r13
|
||||
pub const TLS_OFFSET_R13: u64 = 0x860;
|
||||
pub const TLS_OFFSET_R13: bsl::SafeU64 = bsl::SafeU64::new(0x860);
|
||||
/// @brief stores the offset for r14
|
||||
pub const TLS_OFFSET_R14: u64 = 0x868;
|
||||
pub const TLS_OFFSET_R14: bsl::SafeU64 = bsl::SafeU64::new(0x868);
|
||||
/// @brief stores the offset for r15
|
||||
pub const TLS_OFFSET_R15: u64 = 0x870;
|
||||
pub const TLS_OFFSET_R15: bsl::SafeU64 = bsl::SafeU64::new(0x870);
|
||||
/// @brief stores the offset of the active extid
|
||||
pub const TLS_OFFSET_ACTIVE_EXTID: u64 = 0xFF0;
|
||||
pub const TLS_OFFSET_ACTIVE_EXTID: bsl::SafeU64 = bsl::SafeU64::new(0xFF0);
|
||||
/// @brief stores the offset of the active vmid
|
||||
pub const TLS_OFFSET_ACTIVE_VMID: u64 = 0xFF2;
|
||||
pub const TLS_OFFSET_ACTIVE_VMID: bsl::SafeU64 = bsl::SafeU64::new(0xFF2);
|
||||
/// @brief stores the offset of the active vpid
|
||||
pub const TLS_OFFSET_ACTIVE_VPID: u64 = 0xFF4;
|
||||
pub const TLS_OFFSET_ACTIVE_VPID: bsl::SafeU64 = bsl::SafeU64::new(0xFF4);
|
||||
/// @brief stores the offset of the active vsid
|
||||
pub const TLS_OFFSET_ACTIVE_VSID: u64 = 0xFF6;
|
||||
pub const TLS_OFFSET_ACTIVE_VSID: bsl::SafeU64 = bsl::SafeU64::new(0xFF6);
|
||||
/// @brief stores the offset of the active ppid
|
||||
pub const TLS_OFFSET_ACTIVE_PPID: u64 = 0xFF8;
|
||||
pub const TLS_OFFSET_ACTIVE_PPID: bsl::SafeU64 = bsl::SafeU64::new(0xFF8);
|
||||
/// @brief stores the number of PPs that are online
|
||||
pub const TLS_OFFSET_ONLINE_PPS: u64 = 0xFFA;
|
||||
pub const TLS_OFFSET_ONLINE_PPS: bsl::SafeU64 = bsl::SafeU64::new(0xFFA);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Hypercall Related Constants
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief Defines an invalid handle
|
||||
pub const BF_INVALID_HANDLE: u64 = 0xFFFFFFFFFFFFFFFF;
|
||||
pub const BF_INVALID_HANDLE: bsl::SafeU64 = bsl::SafeU64::new(0xFFFFFFFFFFFFFFFF);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// Syscall Indexes
|
||||
// -------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @brief Defines the index for bf_control_op_exit
|
||||
pub const BF_CONTROL_OP_EXIT_IDX_VAL: u64 = 0x0000000000000000;
|
||||
pub const BF_CONTROL_OP_EXIT_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000000);
|
||||
/// @brief Defines the index for bf_control_op_wait
|
||||
pub const BF_CONTROL_OP_WAIT_IDX_VAL: u64 = 0x0000000000000001;
|
||||
pub const BF_CONTROL_OP_WAIT_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000001);
|
||||
/// @brief Defines the index for bf_control_op_again
|
||||
pub const BF_CONTROL_OP_AGAIN_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000002);
|
||||
|
||||
/// @brief Defines the index for bf_handle_op_open_handle
|
||||
pub const BF_HANDLE_OP_OPEN_HANDLE_IDX_VAL: u64 = 0x0000000000000000;
|
||||
pub const BF_HANDLE_OP_OPEN_HANDLE_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000000);
|
||||
/// @brief Defines the index for bf_handle_op_close_handle
|
||||
pub const BF_HANDLE_OP_CLOSE_HANDLE_IDX_VAL: u64 = 0x0000000000000001;
|
||||
pub const BF_HANDLE_OP_CLOSE_HANDLE_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000001);
|
||||
|
||||
/// @brief Defines the index for bf_debug_op_out
|
||||
pub const BF_DEBUG_OP_OUT_IDX_VAL: u64 = 0x0000000000000000;
|
||||
pub const BF_DEBUG_OP_OUT_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000000);
|
||||
/// @brief Defines the index for bf_debug_op_dump_vm
|
||||
pub const BF_DEBUG_OP_DUMP_VM_IDX_VAL: u64 = 0x0000000000000001;
|
||||
pub const BF_DEBUG_OP_DUMP_VM_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000001);
|
||||
/// @brief Defines the index for bf_debug_op_dump_vp
|
||||
pub const BF_DEBUG_OP_DUMP_VP_IDX_VAL: u64 = 0x0000000000000002;
|
||||
pub const BF_DEBUG_OP_DUMP_VP_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000002);
|
||||
/// @brief Defines the index for bf_debug_op_dump_vs
|
||||
pub const BF_DEBUG_OP_DUMP_VS_IDX_VAL: u64 = 0x0000000000000003;
|
||||
pub const BF_DEBUG_OP_DUMP_VS_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000003);
|
||||
/// @brief Defines the index for bf_debug_op_dump_vmexit_log
|
||||
pub const BF_DEBUG_OP_DUMP_VMEXIT_LOG_IDX_VAL: u64 = 0x0000000000000004;
|
||||
pub const BF_DEBUG_OP_DUMP_VMEXIT_LOG_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000004);
|
||||
/// @brief Defines the index for bf_debug_op_write_c
|
||||
pub const BF_DEBUG_OP_WRITE_C_IDX_VAL: u64 = 0x0000000000000005;
|
||||
pub const BF_DEBUG_OP_WRITE_C_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000005);
|
||||
/// @brief Defines the index for bf_debug_op_write_str
|
||||
pub const BF_DEBUG_OP_WRITE_STR_IDX_VAL: u64 = 0x0000000000000006;
|
||||
pub const BF_DEBUG_OP_WRITE_STR_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000006);
|
||||
/// @brief Defines the index for bf_debug_op_dump_ext
|
||||
pub const BF_DEBUG_OP_DUMP_EXT_IDX_VAL: u64 = 0x0000000000000007;
|
||||
pub const BF_DEBUG_OP_DUMP_EXT_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000007);
|
||||
/// @brief Defines the index for bf_debug_op_dump_page_pool
|
||||
pub const BF_DEBUG_OP_DUMP_PAGE_POOL_IDX_VAL: u64 = 0x0000000000000008;
|
||||
pub const BF_DEBUG_OP_DUMP_PAGE_POOL_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000008);
|
||||
/// @brief Defines the index for bf_debug_op_dump_huge_pool
|
||||
pub const BF_DEBUG_OP_DUMP_HUGE_POOL_IDX_VAL: u64 = 0x0000000000000009;
|
||||
pub const BF_DEBUG_OP_DUMP_HUGE_POOL_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000009);
|
||||
|
||||
/// @brief Defines the index for bf_callback_op_register_bootstrap
|
||||
pub const BF_CALLBACK_OP_REGISTER_BOOTSTRAP_IDX_VAL: u64 = 0x0000000000000000;
|
||||
pub const BF_CALLBACK_OP_REGISTER_BOOTSTRAP_IDX_VAL: bsl::SafeU64 =
|
||||
bsl::SafeU64::new(0x0000000000000000);
|
||||
/// @brief Defines the index for bf_callback_op_register_vmexit
|
||||
pub const BF_CALLBACK_OP_REGISTER_VMEXIT_IDX_VAL: u64 = 0x0000000000000001;
|
||||
pub const BF_CALLBACK_OP_REGISTER_VMEXIT_IDX_VAL: bsl::SafeU64 =
|
||||
bsl::SafeU64::new(0x0000000000000001);
|
||||
/// @brief Defines the index for bf_callback_op_register_fail
|
||||
pub const BF_CALLBACK_OP_REGISTER_FAIL_IDX_VAL: u64 = 0x0000000000000002;
|
||||
pub const BF_CALLBACK_OP_REGISTER_FAIL_IDX_VAL: bsl::SafeU64 =
|
||||
bsl::SafeU64::new(0x0000000000000002);
|
||||
|
||||
/// @brief Defines the index for bf_vm_op_create_vm
|
||||
pub const BF_VM_OP_CREATE_VM_IDX_VAL: u64 = 0x0000000000000000;
|
||||
pub const BF_VM_OP_CREATE_VM_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000000);
|
||||
/// @brief Defines the index for bf_vm_op_destroy_vm
|
||||
pub const BF_VM_OP_DESTROY_VM_IDX_VAL: u64 = 0x0000000000000001;
|
||||
pub const BF_VM_OP_DESTROY_VM_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000001);
|
||||
/// @brief Defines the index for bf_vm_op_map_direct
|
||||
pub const BF_VM_OP_MAP_DIRECT_IDX_VAL: u64 = 0x0000000000000002;
|
||||
pub const BF_VM_OP_MAP_DIRECT_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000002);
|
||||
/// @brief Defines the index for bf_vm_op_unmap_direct
|
||||
pub const BF_VM_OP_UNMAP_DIRECT_IDX_VAL: u64 = 0x0000000000000003;
|
||||
pub const BF_VM_OP_UNMAP_DIRECT_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000003);
|
||||
/// @brief Defines the index for bf_vm_op_unmap_direct_broadcast
|
||||
pub const BF_VM_OP_UNMAP_DIRECT_BROADCAST_IDX_VAL: u64 = 0x0000000000000004;
|
||||
pub const BF_VM_OP_UNMAP_DIRECT_BROADCAST_IDX_VAL: bsl::SafeU64 =
|
||||
bsl::SafeU64::new(0x0000000000000004);
|
||||
/// @brief Defines the index for bf_vm_op_tlb_flush
|
||||
pub const BF_VM_OP_TLB_FLUSH_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000005);
|
||||
|
||||
/// @brief Defines the index for bf_vp_op_create_vp
|
||||
pub const BF_VP_OP_CREATE_VP_IDX_VAL: u64 = 0x0000000000000000;
|
||||
pub const BF_VP_OP_CREATE_VP_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000000);
|
||||
/// @brief Defines the index for bf_vp_op_destroy_vp
|
||||
pub const BF_VP_OP_DESTROY_VP_IDX_VAL: u64 = 0x0000000000000001;
|
||||
pub const BF_VP_OP_DESTROY_VP_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000001);
|
||||
|
||||
/// @brief Defines the index for bf_vs_op_create_vs
|
||||
pub const BF_VS_OP_CREATE_VS_IDX_VAL: u64 = 0x0000000000000000;
|
||||
pub const BF_VS_OP_CREATE_VS_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000000);
|
||||
/// @brief Defines the index for bf_vs_op_destroy_vs
|
||||
pub const BF_VS_OP_DESTROY_VS_IDX_VAL: u64 = 0x0000000000000001;
|
||||
pub const BF_VS_OP_DESTROY_VS_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000001);
|
||||
/// @brief Defines the index for bf_vs_op_init_as_root
|
||||
pub const BF_VS_OP_INIT_AS_ROOT_IDX_VAL: u64 = 0x0000000000000002;
|
||||
pub const BF_VS_OP_INIT_AS_ROOT_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000002);
|
||||
/// @brief Defines the index for bf_vs_op_read_reg
|
||||
pub const BF_VS_OP_READ_IDX_VAL: u64 = 0x0000000000000003;
|
||||
pub const BF_VS_OP_READ_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000003);
|
||||
/// @brief Defines the index for bf_vs_op_write_reg
|
||||
pub const BF_VS_OP_WRITE_IDX_VAL: u64 = 0x0000000000000004;
|
||||
pub const BF_VS_OP_WRITE_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000004);
|
||||
/// @brief Defines the index for bf_vs_op_run
|
||||
pub const BF_VS_OP_RUN_IDX_VAL: u64 = 0x0000000000000005;
|
||||
pub const BF_VS_OP_RUN_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000005);
|
||||
/// @brief Defines the index for bf_vs_op_run_current
|
||||
pub const BF_VS_OP_RUN_CURRENT_IDX_VAL: u64 = 0x0000000000000006;
|
||||
pub const BF_VS_OP_RUN_CURRENT_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000006);
|
||||
/// @brief Defines the index for bf_vs_op_advance_ip_and_run
|
||||
pub const BF_VS_OP_ADVANCE_IP_AND_RUN_IDX_VAL: u64 = 0x0000000000000007;
|
||||
pub const BF_VS_OP_ADVANCE_IP_AND_RUN_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000007);
|
||||
/// @brief Defines the index for bf_vs_op_advance_ip_and_run_current
|
||||
pub const BF_VS_OP_ADVANCE_IP_AND_RUN_CURRENT_IDX_VAL: u64 = 0x0000000000000008;
|
||||
pub const BF_VS_OP_ADVANCE_IP_AND_RUN_CURRENT_IDX_VAL: bsl::SafeU64 =
|
||||
bsl::SafeU64::new(0x0000000000000008);
|
||||
/// @brief Defines the index for bf_vs_op_promote
|
||||
pub const BF_VS_OP_PROMOTE_IDX_VAL: u64 = 0x0000000000000009;
|
||||
pub const BF_VS_OP_PROMOTE_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000009);
|
||||
/// @brief Defines the index for bf_vs_op_clear
|
||||
pub const BF_VS_OP_CLEAR_IDX_VAL: u64 = 0x000000000000000A;
|
||||
pub const BF_VS_OP_CLEAR_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x000000000000000A);
|
||||
/// @brief Defines the index for bf_vs_op_migrate
|
||||
pub const BF_VS_OP_MIGRATE_IDX_VAL: u64 = 0x000000000000000B;
|
||||
pub const BF_VS_OP_MIGRATE_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x000000000000000B);
|
||||
/// @brief Defines the index for bf_vs_op_set_active
|
||||
pub const BF_VS_OP_SET_ACTIVE_IDX_VAL: u64 = 0x000000000000000C;
|
||||
pub const BF_VS_OP_SET_ACTIVE_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x000000000000000C);
|
||||
/// @brief Defines the index for bf_vs_op_advance_ip_and_set_active
|
||||
pub const BF_VS_OP_ADVANCE_IP_AND_SET_ACTIVE_IDX_VAL: u64 = 0x000000000000000D;
|
||||
pub const BF_VS_OP_ADVANCE_IP_AND_SET_ACTIVE_IDX_VAL: bsl::SafeU64 =
|
||||
bsl::SafeU64::new(0x000000000000000D);
|
||||
/// @brief Defines the index for bf_vs_op_tlb_flush
|
||||
pub const BF_VS_OP_TLB_FLUSH_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x000000000000000E);
|
||||
|
||||
/// @brief Defines the index for bf_intrinsic_op_rdmsr
|
||||
pub const BF_INTRINSIC_OP_RDMSR_IDX_VAL: u64 = 0x0000000000000000;
|
||||
pub const BF_INTRINSIC_OP_RDMSR_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000000);
|
||||
/// @brief Defines the index for bf_intrinsic_op_wrmsr
|
||||
pub const BF_INTRINSIC_OP_WRMSR_IDX_VAL: u64 = 0x0000000000000001;
|
||||
pub const BF_INTRINSIC_OP_WRMSR_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000001);
|
||||
|
||||
/// @brief Defines the index for bf_mem_op_alloc_page
|
||||
pub const BF_MEM_OP_ALLOC_PAGE_IDX_VAL: u64 = 0x0000000000000000;
|
||||
pub const BF_MEM_OP_ALLOC_PAGE_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000000);
|
||||
/// @brief Defines the index for bf_mem_op_alloc_huge
|
||||
pub const BF_MEM_OP_ALLOC_HUGE_IDX_VAL: u64 = 0x0000000000000002;
|
||||
pub const BF_MEM_OP_ALLOC_HUGE_IDX_VAL: bsl::SafeU64 = bsl::SafeU64::new(0x0000000000000002);
|
||||
|
|
@ -27,4 +27,4 @@
|
|||
// -------------------------------------------------------------------------
|
||||
|
||||
/// @brief Defines the type used for returning status from a function
|
||||
pub type BfStatusT = u64;
|
||||
pub type BfStatusT = bsl::SafeU64;
|
||||
|
|
@ -22,231 +22,247 @@
|
|||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
/// SOFTWARE.
|
||||
|
||||
/// @brief defines an unsupported register
|
||||
pub const BF_REG_T_UNSUPPORTED: u64 = 0;
|
||||
/// @brief defines the rbx register
|
||||
const BF_REG_T_RBX:u64 = 1;
|
||||
pub const BF_REG_T_RBX: u64 = 1;
|
||||
/// @brief defines the rcx register
|
||||
const BF_REG_T_RCX:u64 = 2;
|
||||
pub const BF_REG_T_RCX: u64 = 2;
|
||||
/// @brief defines the rdx register
|
||||
const BF_REG_T_RDX:u64 = 3;
|
||||
pub const BF_REG_T_RDX: u64 = 3;
|
||||
/// @brief defines the rbp register
|
||||
const BF_REG_T_RBP:u64 = 4;
|
||||
pub const BF_REG_T_RBP: u64 = 4;
|
||||
/// @brief defines the rsi register
|
||||
const BF_REG_T_RSI:u64 = 5;
|
||||
pub const BF_REG_T_RSI: u64 = 5;
|
||||
/// @brief defines the rdi register
|
||||
const BF_REG_T_RDI:u64 = 6;
|
||||
pub const BF_REG_T_RDI: u64 = 6;
|
||||
/// @brief defines the r8 register
|
||||
const BF_REG_T_R8:u64 = 7;
|
||||
pub const BF_REG_T_R8: u64 = 7;
|
||||
/// @brief defines the r9 register
|
||||
const BF_REG_T_R9:u64 = 8;
|
||||
pub const BF_REG_T_R9: u64 = 8;
|
||||
/// @brief defines the r10 register
|
||||
const BF_REG_T_R10:u64 = 9;
|
||||
pub const BF_REG_T_R10: u64 = 9;
|
||||
/// @brief defines the r11 register
|
||||
const BF_REG_T_R11:u64 = 10;
|
||||
pub const BF_REG_T_R11: u64 = 10;
|
||||
/// @brief defines the r12 register
|
||||
const BF_REG_T_R12:u64 = 11;
|
||||
pub const BF_REG_T_R12: u64 = 11;
|
||||
/// @brief defines the r13 register
|
||||
const BF_REG_T_R13:u64 = 12;
|
||||
pub const BF_REG_T_R13: u64 = 12;
|
||||
/// @brief defines the r14 register
|
||||
const BF_REG_T_R14:u64 = 13;
|
||||
pub const BF_REG_T_R14: u64 = 13;
|
||||
/// @brief defines the r15 register
|
||||
const BF_REG_T_R15:u64 = 14;
|
||||
/// @brief defines the intercept_cr_read register in the VMCB
|
||||
const BF_REG_T_INTERCEPT_CR_READ:u64 = 15;
|
||||
/// @brief defines the intercept_cr_write register in the VMCB
|
||||
const BF_REG_T_INTERCEPT_CR_WRITE:u64 = 16;
|
||||
/// @brief defines the intercept_dr_read register in the VMCB
|
||||
const BF_REG_T_INTERCEPT_DR_READ:u64 = 17;
|
||||
/// @brief defines the intercept_dr_write register in the VMCB
|
||||
const BF_REG_T_INTERCEPT_DR_WRITE:u64 = 18;
|
||||
/// @brief defines the intercept_exception register in the VMCB
|
||||
const BF_REG_T_INTERCEPT_EXCEPTION:u64 = 19;
|
||||
/// @brief defines the intercept_instruction1 register in the VMCB
|
||||
const BF_REG_T_INTERCEPT_INSTRUCTION1:u64 = 20;
|
||||
/// @brief defines the intercept_instruction2 register in the VMCB
|
||||
const BF_REG_T_INTERCEPT_INSTRUCTION2:u64 = 21;
|
||||
/// @brief defines the intercept_instruction3 register in the VMCB
|
||||
const BF_REG_T_INTERCEPT_INSTRUCTION3:u64 = 22;
|
||||
/// @brief defines the pause_filter_threshold register in the VMCB
|
||||
const BF_REG_T_PAUSE_FILTER_THRESHOLD:u64 = 23;
|
||||
/// @brief defines the pause_filter_count register in the VMCB
|
||||
const BF_REG_T_PAUSE_FILTER_COUNT:u64 = 24;
|
||||
/// @brief defines the iopm_base_pa register in the VMCB
|
||||
const BF_REG_T_IOPM_BASE_PA:u64 = 25;
|
||||
/// @brief defines the msrpm_base_pa register in the VMCB
|
||||
const BF_REG_T_MSRPM_BASE_PA:u64 = 26;
|
||||
/// @brief defines the tsc_offset register in the VMCB
|
||||
const BF_REG_T_TSC_OFFSET:u64 = 27;
|
||||
/// @brief defines the guest_asid register in the VMCB
|
||||
const BF_REG_T_GUEST_ASID:u64 = 28;
|
||||
/// @brief defines the tlb_control register in the VMCB
|
||||
const BF_REG_T_TLB_CONTROL:u64 = 29;
|
||||
/// @brief defines the virtual_interrupt_a register in the VMCB
|
||||
const BF_REG_T_VIRTUAL_INTERRUPT_A:u64 = 30;
|
||||
/// @brief defines the virtual_interrupt_b register in the VMCB
|
||||
const BF_REG_T_VIRTUAL_INTERRUPT_B:u64 = 31;
|
||||
/// @brief defines the exitcode register in the VMCB
|
||||
const BF_REG_T_EXITCODE:u64 = 32;
|
||||
/// @brief defines the exitinfo1 register in the VMCB
|
||||
const BF_REG_T_EXITINFO1:u64 = 33;
|
||||
/// @brief defines the exitinfo2 register in the VMCB
|
||||
const BF_REG_T_EXITINFO2:u64 = 34;
|
||||
/// @brief defines the exitininfo register in the VMCB
|
||||
const BF_REG_T_EXITININFO:u64 = 35;
|
||||
/// @brief defines the ctls1 register in the VMCB
|
||||
const BF_REG_T_CTLS1:u64 = 36;
|
||||
/// @brief defines the avic_apic_bar register in the VMCB
|
||||
const BF_REG_T_AVIC_APIC_BAR:u64 = 37;
|
||||
/// @brief defines the guest_pa_of_ghcb register in the VMCB
|
||||
const BF_REG_T_GUEST_PA_OF_GHCB:u64 = 38;
|
||||
/// @brief defines the eventinj register in the VMCB
|
||||
const BF_REG_T_EVENTINJ:u64 = 39;
|
||||
/// @brief defines the n_cr3 register in the VMCB
|
||||
const BF_REG_T_N_CR3:u64 = 40;
|
||||
/// @brief defines the ctls2 register in the VMCB
|
||||
const BF_REG_T_CTLS2:u64 = 41;
|
||||
/// @brief defines the vmcb_clean_bits register in the VMCB
|
||||
const BF_REG_T_VMCB_CLEAN_BITS:u64 = 42;
|
||||
/// @brief defines the nrip register in the VMCB
|
||||
const BF_REG_T_NRIP:u64 = 43;
|
||||
/// @brief defines the number_of_bytes_fetched register in the VMCB
|
||||
const BF_REG_T_NUMBER_OF_BYTES_FETCHED:u64 = 44;
|
||||
/// @brief defines the avic_apic_backing_page_ptr register in the VMCB
|
||||
const BF_REG_T_AVIC_APIC_BACKING_PAGE_PTR:u64 = 45;
|
||||
/// @brief defines the avic_logical_table_ptr register in the VMCB
|
||||
const BF_REG_T_AVIC_LOGICAL_TABLE_PTR:u64 = 46;
|
||||
/// @brief defines the avic_physical_table_ptr register in the VMCB
|
||||
const BF_REG_T_AVIC_PHYSICAL_TABLE_PTR:u64 = 47;
|
||||
/// @brief defines the vmsa_ptr register in the VMCB
|
||||
const BF_REG_T_VMSA_PTR:u64 = 48;
|
||||
/// @brief defines the es_selector register in the VMCB
|
||||
const BF_REG_T_ES_SELECTOR:u64 = 49;
|
||||
/// @brief defines the es_attrib register in the VMCB
|
||||
const BF_REG_T_ES_ATTRIB:u64 = 50;
|
||||
/// @brief defines the es_limit register in the VMCB
|
||||
const BF_REG_T_ES_LIMIT:u64 = 51;
|
||||
/// @brief defines the es_base register in the VMCB
|
||||
const BF_REG_T_ES_BASE:u64 = 52;
|
||||
/// @brief defines the cs_selector register in the VMCB
|
||||
const BF_REG_T_CS_SELECTOR:u64 = 53;
|
||||
/// @brief defines the cs_attrib register in the VMCB
|
||||
const BF_REG_T_CS_ATTRIB:u64 = 54;
|
||||
/// @brief defines the cs_limit register in the VMCB
|
||||
const BF_REG_T_CS_LIMIT:u64 = 55;
|
||||
/// @brief defines the cs_base register in the VMCB
|
||||
const BF_REG_T_CS_BASE:u64 = 56;
|
||||
/// @brief defines the ss_selector register in the VMCB
|
||||
const BF_REG_T_SS_SELECTOR:u64 = 57;
|
||||
/// @brief defines the ss_attrib register in the VMCB
|
||||
const BF_REG_T_SS_ATTRIB:u64 = 58;
|
||||
/// @brief defines the ss_limit register in the VMCB
|
||||
const BF_REG_T_SS_LIMIT:u64 = 59;
|
||||
/// @brief defines the ss_base register in the VMCB
|
||||
const BF_REG_T_SS_BASE:u64 = 60;
|
||||
/// @brief defines the ds_selector register in the VMCB
|
||||
const BF_REG_T_DS_SELECTOR:u64 = 61;
|
||||
/// @brief defines the ds_attrib register in the VMCB
|
||||
const BF_REG_T_DS_ATTRIB:u64 = 62;
|
||||
/// @brief defines the ds_limit register in the VMCB
|
||||
const BF_REG_T_DS_LIMIT:u64 = 63;
|
||||
/// @brief defines the ds_base register in the VMCB
|
||||
const BF_REG_T_DS_BASE:u64 = 64;
|
||||
/// @brief defines the fs_selector register in the VMCB
|
||||
const BF_REG_T_FS_SELECTOR:u64 = 65;
|
||||
/// @brief defines the fs_attrib register in the VMCB
|
||||
const BF_REG_T_FS_ATTRIB:u64 = 66;
|
||||
/// @brief defines the fs_limit register in the VMCB
|
||||
const BF_REG_T_FS_LIMIT:u64 = 67;
|
||||
/// @brief defines the fs_base register in the VMCB
|
||||
const BF_REG_T_FS_BASE:u64 = 68;
|
||||
/// @brief defines the gs_selector register in the VMCB
|
||||
const BF_REG_T_GS_SELECTOR:u64 = 69;
|
||||
/// @brief defines the gs_attrib register in the VMCB
|
||||
const BF_REG_T_GS_ATTRIB:u64 = 70;
|
||||
/// @brief defines the gs_limit register in the VMCB
|
||||
const BF_REG_T_GS_LIMIT:u64 = 71;
|
||||
/// @brief defines the gs_base register in the VMCB
|
||||
const BF_REG_T_GS_BASE:u64 = 72;
|
||||
/// @brief defines the gdtr_selector register in the VMCB
|
||||
const BF_REG_T_GDTR_SELECTOR:u64 = 73;
|
||||
/// @brief defines the gdtr_attrib register in the VMCB
|
||||
const BF_REG_T_GDTR_ATTRIB:u64 = 74;
|
||||
/// @brief defines the gdtr_limit register in the VMCB
|
||||
const BF_REG_T_GDTR_LIMIT:u64 = 75;
|
||||
/// @brief defines the gdtr_base register in the VMCB
|
||||
const BF_REG_T_GDTR_BASE:u64 = 76;
|
||||
/// @brief defines the ldtr_selector register in the VMCB
|
||||
const BF_REG_T_LDTR_SELECTOR:u64 = 77;
|
||||
/// @brief defines the ldtr_attrib register in the VMCB
|
||||
const BF_REG_T_LDTR_ATTRIB:u64 = 78;
|
||||
/// @brief defines the ldtr_limit register in the VMCB
|
||||
const BF_REG_T_LDTR_LIMIT:u64 = 79;
|
||||
/// @brief defines the ldtr_base register in the VMCB
|
||||
const BF_REG_T_LDTR_BASE:u64 = 80;
|
||||
/// @brief defines the idtr_selector register in the VMCB
|
||||
const BF_REG_T_IDTR_SELECTOR:u64 = 81;
|
||||
/// @brief defines the idtr_attrib register in the VMCB
|
||||
const BF_REG_T_IDTR_ATTRIB:u64 = 82;
|
||||
/// @brief defines the idtr_limit register in the VMCB
|
||||
const BF_REG_T_IDTR_LIMIT:u64 = 83;
|
||||
/// @brief defines the idtr_base register in the VMCB
|
||||
const BF_REG_T_IDTR_BASE:u64 = 84;
|
||||
/// @brief defines the tr_selector register in the VMCB
|
||||
const BF_REG_T_TR_SELECTOR:u64 = 85;
|
||||
/// @brief defines the tr_attrib register in the VMCB
|
||||
const BF_REG_T_TR_ATTRIB:u64 = 86;
|
||||
/// @brief defines the tr_limit register in the VMCB
|
||||
const BF_REG_T_TR_LIMIT:u64 = 87;
|
||||
/// @brief defines the tr_base register in the VMCB
|
||||
const BF_REG_T_TR_BASE:u64 = 88;
|
||||
/// @brief defines the cpl register in the VMCB
|
||||
const BF_REG_T_CPL:u64 = 89;
|
||||
/// @brief defines the efer register in the VMCB
|
||||
const BF_REG_T_EFER:u64 = 90;
|
||||
/// @brief defines the cr4 register in the VMCB
|
||||
const BF_REG_T_CR4:u64 = 91;
|
||||
/// @brief defines the cr3 register in the VMCB
|
||||
const BF_REG_T_CR3:u64 = 92;
|
||||
/// @brief defines the cr0 register in the VMCB
|
||||
const BF_REG_T_CR0:u64 = 93;
|
||||
/// @brief defines the dr7 register in the VMCB
|
||||
const BF_REG_T_DR7:u64 = 94;
|
||||
/// @brief defines the dr6 register in the VMCB
|
||||
const BF_REG_T_DR6:u64 = 95;
|
||||
/// @brief defines the rflags register in the VMCB
|
||||
const BF_REG_T_RFLAGS:u64 = 96;
|
||||
/// @brief defines the rip register in the VMCB
|
||||
const BF_REG_T_RIP:u64 = 97;
|
||||
/// @brief defines the rsp register in the VMCB
|
||||
const BF_REG_T_RSP:u64 = 98;
|
||||
/// @brief defines the rax register in the VMCB
|
||||
const BF_REG_T_RAX:u64 = 99;
|
||||
/// @brief defines the star register in the VMCB
|
||||
const BF_REG_T_STAR:u64 = 100;
|
||||
/// @brief defines the lstar register in the VMCB
|
||||
const BF_REG_T_LSTAR:u64 = 101;
|
||||
/// @brief defines the cstar register in the VMCB
|
||||
const BF_REG_T_CSTAR:u64 = 102;
|
||||
/// @brief defines the sfmask register in the VMCB
|
||||
const BF_REG_T_SFMASK:u64 = 103;
|
||||
/// @brief defines the kernel_gs_base register in the VMCB
|
||||
const BF_REG_T_KERNEL_GS_BASE:u64 = 104;
|
||||
/// @brief defines the sysenter_cs register in the VMCB
|
||||
const BF_REG_T_SYSENTER_CS:u64 = 105;
|
||||
/// @brief defines the sysenter_esp register in the VMCB
|
||||
const BF_REG_T_SYSENTER_ESP:u64 = 106;
|
||||
/// @brief defines the sysenter_eip register in the VMCB
|
||||
const BF_REG_T_SYSENTER_EIP:u64 = 107;
|
||||
/// @brief defines the cr2 register in the VMCB
|
||||
const BF_REG_T_CR2:u64 = 108;
|
||||
/// @brief defines the g_pat register in the VMCB
|
||||
const BF_REG_T_G_PAT:u64 = 109;
|
||||
/// @brief defines the dbgctl register in the VMCB
|
||||
const BF_REG_T_DBGCTL:u64 = 110;
|
||||
/// @brief defines the br_from register in the VMCB
|
||||
const BF_REG_T_BR_FROM:u64 = 112;
|
||||
/// @brief defines the br_to register in the VMCB
|
||||
const BF_REG_T_BR_TO:u64 = 113;
|
||||
/// @brief defines the lastexcpfrom register in the VMCB
|
||||
const BF_REG_T_LASTEXCPFROM:u64 = 114;
|
||||
/// @brief defines the lastexcpto register in the VMCB
|
||||
const BF_REG_T_LASTEXCPTO:u64 = 115;
|
||||
pub const BF_REG_T_R15: u64 = 14;
|
||||
/// @brief defines the intercept_cr_read register
|
||||
pub const BF_REG_T_INTERCEPT_CR_READ: u64 = 15;
|
||||
/// @brief defines the intercept_cr_write register
|
||||
pub const BF_REG_T_INTERCEPT_CR_WRITE: u64 = 16;
|
||||
/// @brief defines the intercept_dr_read register
|
||||
pub const BF_REG_T_INTERCEPT_DR_READ: u64 = 17;
|
||||
/// @brief defines the intercept_dr_write register
|
||||
pub const BF_REG_T_INTERCEPT_DR_WRITE: u64 = 18;
|
||||
/// @brief defines the intercept_exception register
|
||||
pub const BF_REG_T_INTERCEPT_EXCEPTION: u64 = 19;
|
||||
/// @brief defines the intercept_instruction1 register
|
||||
pub const BF_REG_T_INTERCEPT_INSTRUCTION1: u64 = 20;
|
||||
/// @brief defines the intercept_instruction2 register
|
||||
pub const BF_REG_T_INTERCEPT_INSTRUCTION2: u64 = 21;
|
||||
/// @brief defines the intercept_instruction3 register
|
||||
pub const BF_REG_T_INTERCEPT_INSTRUCTION3: u64 = 22;
|
||||
/// @brief defines the pause_filter_threshold register
|
||||
pub const BF_REG_T_PAUSE_FILTER_THRESHOLD: u64 = 23;
|
||||
/// @brief defines the pause_filter_count register
|
||||
pub const BF_REG_T_PAUSE_FILTER_COUNT: u64 = 24;
|
||||
/// @brief defines the iopm_base_pa register
|
||||
pub const BF_REG_T_IOPM_BASE_PA: u64 = 25;
|
||||
/// @brief defines the msrpm_base_pa register
|
||||
pub const BF_REG_T_MSRPM_BASE_PA: u64 = 26;
|
||||
/// @brief defines the tsc_offset register
|
||||
pub const BF_REG_T_TSC_OFFSET: u64 = 27;
|
||||
/// @brief defines the guest_asid register
|
||||
pub const BF_REG_T_GUEST_ASID: u64 = 28;
|
||||
/// @brief defines the tlb_control register
|
||||
pub const BF_REG_T_TLB_CONTROL: u64 = 29;
|
||||
/// @brief defines the virtual_interrupt_a register
|
||||
pub const BF_REG_T_VIRTUAL_INTERRUPT_A: u64 = 30;
|
||||
/// @brief defines the virtual_interrupt_b register
|
||||
pub const BF_REG_T_VIRTUAL_INTERRUPT_B: u64 = 31;
|
||||
/// @brief defines the exitcode register
|
||||
pub const BF_REG_T_EXITCODE: u64 = 32;
|
||||
/// @brief defines the exitinfo1 register
|
||||
pub const BF_REG_T_EXITINFO1: u64 = 33;
|
||||
/// @brief defines the exitinfo2 register
|
||||
pub const BF_REG_T_EXITINFO2: u64 = 34;
|
||||
/// @brief defines the exitininfo register
|
||||
pub const BF_REG_T_EXITININFO: u64 = 35;
|
||||
/// @brief defines the ctls1 register
|
||||
pub const BF_REG_T_CTLS1: u64 = 36;
|
||||
/// @brief defines the avic_apic_bar register
|
||||
pub const BF_REG_T_AVIC_APIC_BAR: u64 = 37;
|
||||
/// @brief defines the guest_pa_of_ghcb register
|
||||
pub const BF_REG_T_GUEST_PA_OF_GHCB: u64 = 38;
|
||||
/// @brief defines the eventinj register
|
||||
pub const BF_REG_T_EVENTINJ: u64 = 39;
|
||||
/// @brief defines the n_cr3 register
|
||||
pub const BF_REG_T_N_CR3: u64 = 40;
|
||||
/// @brief defines the ctls2 register
|
||||
pub const BF_REG_T_CTLS2: u64 = 41;
|
||||
/// @brief defines the vmcb_clean_bits register
|
||||
pub const BF_REG_T_VMCB_CLEAN_BITS: u64 = 42;
|
||||
/// @brief defines the nrip register
|
||||
pub const BF_REG_T_NRIP: u64 = 43;
|
||||
/// @brief defines the number_of_bytes_fetched register
|
||||
pub const BF_REG_T_NUMBER_OF_BYTES_FETCHED: u64 = 44;
|
||||
/// @brief defines the avic_apic_backing_page_ptr register
|
||||
pub const BF_REG_T_AVIC_APIC_BACKING_PAGE_PTR: u64 = 45;
|
||||
/// @brief defines the avic_logical_table_ptr register
|
||||
pub const BF_REG_T_AVIC_LOGICAL_TABLE_PTR: u64 = 46;
|
||||
/// @brief defines the avic_physical_table_ptr register
|
||||
pub const BF_REG_T_AVIC_PHYSICAL_TABLE_PTR: u64 = 47;
|
||||
/// @brief defines the vmsa_ptr register
|
||||
pub const BF_REG_T_VMSA_PTR: u64 = 48;
|
||||
/// @brief defines the es_selector register
|
||||
pub const BF_REG_T_ES_SELECTOR: u64 = 49;
|
||||
/// @brief defines the es_attrib register
|
||||
pub const BF_REG_T_ES_ATTRIB: u64 = 50;
|
||||
/// @brief defines the es_limit register
|
||||
pub const BF_REG_T_ES_LIMIT: u64 = 51;
|
||||
/// @brief defines the es_base register
|
||||
pub const BF_REG_T_ES_BASE: u64 = 52;
|
||||
/// @brief defines the cs_selector register
|
||||
pub const BF_REG_T_CS_SELECTOR: u64 = 53;
|
||||
/// @brief defines the cs_attrib register
|
||||
pub const BF_REG_T_CS_ATTRIB: u64 = 54;
|
||||
/// @brief defines the cs_limit register
|
||||
pub const BF_REG_T_CS_LIMIT: u64 = 55;
|
||||
/// @brief defines the cs_base register
|
||||
pub const BF_REG_T_CS_BASE: u64 = 56;
|
||||
/// @brief defines the ss_selector register
|
||||
pub const BF_REG_T_SS_SELECTOR: u64 = 57;
|
||||
/// @brief defines the ss_attrib register
|
||||
pub const BF_REG_T_SS_ATTRIB: u64 = 58;
|
||||
/// @brief defines the ss_limit register
|
||||
pub const BF_REG_T_SS_LIMIT: u64 = 59;
|
||||
/// @brief defines the ss_base register
|
||||
pub const BF_REG_T_SS_BASE: u64 = 60;
|
||||
/// @brief defines the ds_selector register
|
||||
pub const BF_REG_T_DS_SELECTOR: u64 = 61;
|
||||
/// @brief defines the ds_attrib register
|
||||
pub const BF_REG_T_DS_ATTRIB: u64 = 62;
|
||||
/// @brief defines the ds_limit register
|
||||
pub const BF_REG_T_DS_LIMIT: u64 = 63;
|
||||
/// @brief defines the ds_base register
|
||||
pub const BF_REG_T_DS_BASE: u64 = 64;
|
||||
/// @brief defines the fs_selector register
|
||||
pub const BF_REG_T_FS_SELECTOR: u64 = 65;
|
||||
/// @brief defines the fs_attrib register
|
||||
pub const BF_REG_T_FS_ATTRIB: u64 = 66;
|
||||
/// @brief defines the fs_limit register
|
||||
pub const BF_REG_T_FS_LIMIT: u64 = 67;
|
||||
/// @brief defines the fs_base register
|
||||
pub const BF_REG_T_FS_BASE: u64 = 68;
|
||||
/// @brief defines the gs_selector register
|
||||
pub const BF_REG_T_GS_SELECTOR: u64 = 69;
|
||||
/// @brief defines the gs_attrib register
|
||||
pub const BF_REG_T_GS_ATTRIB: u64 = 70;
|
||||
/// @brief defines the gs_limit register
|
||||
pub const BF_REG_T_GS_LIMIT: u64 = 71;
|
||||
/// @brief defines the gs_base register
|
||||
pub const BF_REG_T_GS_BASE: u64 = 72;
|
||||
/// @brief defines the gdtr_selector register
|
||||
pub const BF_REG_T_GDTR_SELECTOR: u64 = 73;
|
||||
/// @brief defines the gdtr_attrib register
|
||||
pub const BF_REG_T_GDTR_ATTRIB: u64 = 74;
|
||||
/// @brief defines the gdtr_limit register
|
||||
pub const BF_REG_T_GDTR_LIMIT: u64 = 75;
|
||||
/// @brief defines the gdtr_base register
|
||||
pub const BF_REG_T_GDTR_BASE: u64 = 76;
|
||||
/// @brief defines the ldtr_selector register
|
||||
pub const BF_REG_T_LDTR_SELECTOR: u64 = 77;
|
||||
/// @brief defines the ldtr_attrib register
|
||||
pub const BF_REG_T_LDTR_ATTRIB: u64 = 78;
|
||||
/// @brief defines the ldtr_limit register
|
||||
pub const BF_REG_T_LDTR_LIMIT: u64 = 79;
|
||||
/// @brief defines the ldtr_base register
|
||||
pub const BF_REG_T_LDTR_BASE: u64 = 80;
|
||||
/// @brief defines the idtr_selector register
|
||||
pub const BF_REG_T_IDTR_SELECTOR: u64 = 81;
|
||||
/// @brief defines the idtr_attrib register
|
||||
pub const BF_REG_T_IDTR_ATTRIB: u64 = 82;
|
||||
/// @brief defines the idtr_limit register
|
||||
pub const BF_REG_T_IDTR_LIMIT: u64 = 83;
|
||||
/// @brief defines the idtr_base register
|
||||
pub const BF_REG_T_IDTR_BASE: u64 = 84;
|
||||
/// @brief defines the tr_selector register
|
||||
pub const BF_REG_T_TR_SELECTOR: u64 = 85;
|
||||
/// @brief defines the tr_attrib register
|
||||
pub const BF_REG_T_TR_ATTRIB: u64 = 86;
|
||||
/// @brief defines the tr_limit register
|
||||
pub const BF_REG_T_TR_LIMIT: u64 = 87;
|
||||
/// @brief defines the tr_base register
|
||||
pub const BF_REG_T_TR_BASE: u64 = 88;
|
||||
/// @brief defines the cpl register
|
||||
pub const BF_REG_T_CPL: u64 = 89;
|
||||
/// @brief defines the efer register
|
||||
pub const BF_REG_T_EFER: u64 = 90;
|
||||
/// @brief defines the cr4 register
|
||||
pub const BF_REG_T_CR4: u64 = 91;
|
||||
/// @brief defines the cr3 register
|
||||
pub const BF_REG_T_CR3: u64 = 92;
|
||||
/// @brief defines the cr0 register
|
||||
pub const BF_REG_T_CR0: u64 = 93;
|
||||
/// @brief defines the dr7 register
|
||||
pub const BF_REG_T_DR7: u64 = 94;
|
||||
/// @brief defines the dr6 register
|
||||
pub const BF_REG_T_DR6: u64 = 95;
|
||||
/// @brief defines the rflags register
|
||||
pub const BF_REG_T_RFLAGS: u64 = 96;
|
||||
/// @brief defines the rip register
|
||||
pub const BF_REG_T_RIP: u64 = 97;
|
||||
/// @brief defines the rsp register
|
||||
pub const BF_REG_T_RSP: u64 = 98;
|
||||
/// @brief defines the rax register
|
||||
pub const BF_REG_T_RAX: u64 = 99;
|
||||
/// @brief defines the star register
|
||||
pub const BF_REG_T_STAR: u64 = 100;
|
||||
/// @brief defines the lstar register
|
||||
pub const BF_REG_T_LSTAR: u64 = 101;
|
||||
/// @brief defines the cstar register
|
||||
pub const BF_REG_T_CSTAR: u64 = 102;
|
||||
/// @brief defines the fmask register
|
||||
pub const BF_REG_T_FMASK: u64 = 103;
|
||||
/// @brief defines the kernel_gs_base register
|
||||
pub const BF_REG_T_KERNEL_GS_BASE: u64 = 104;
|
||||
/// @brief defines the sysenter_cs register
|
||||
pub const BF_REG_T_SYSENTER_CS: u64 = 105;
|
||||
/// @brief defines the sysenter_esp register
|
||||
pub const BF_REG_T_SYSENTER_ESP: u64 = 106;
|
||||
/// @brief defines the sysenter_eip register
|
||||
pub const BF_REG_T_SYSENTER_EIP: u64 = 107;
|
||||
/// @brief defines the cr2 register
|
||||
pub const BF_REG_T_CR2: u64 = 108;
|
||||
/// @brief defines the pat register
|
||||
pub const BF_REG_T_PAT: u64 = 109;
|
||||
/// @brief defines the dbgctl register
|
||||
pub const BF_REG_T_DBGCTL: u64 = 110;
|
||||
/// @brief defines the br_from register
|
||||
pub const BF_REG_T_BR_FROM: u64 = 111;
|
||||
/// @brief defines the br_to register
|
||||
pub const BF_REG_T_BR_TO: u64 = 112;
|
||||
/// @brief defines the lastexcpfrom register
|
||||
pub const BF_REG_T_LASTEXCPFROM: u64 = 113;
|
||||
/// @brief defines the lastexcpto register
|
||||
pub const BF_REG_T_LASTEXCPTO: u64 = 114;
|
||||
/// @brief defines the cr8 register
|
||||
pub const BF_REG_T_CR8: u64 = 115;
|
||||
/// @brief defines the dr0 register
|
||||
pub const BF_REG_T_DR0: u64 = 116;
|
||||
/// @brief defines the dr1 register
|
||||
pub const BF_REG_T_DR1: u64 = 117;
|
||||
/// @brief defines the dr2 register
|
||||
pub const BF_REG_T_DR2: u64 = 118;
|
||||
/// @brief defines the dr3 register
|
||||
pub const BF_REG_T_DR3: u64 = 119;
|
||||
/// @brief defines the xcr0 register
|
||||
pub const BF_REG_T_XCR0: u64 = 120;
|
||||
/// @brief defines an invalid register
|
||||
pub const BF_REG_T_INVALID: u64 = 121;
|
||||
|
|
|
|||
|
|
@ -22,315 +22,331 @@
|
|||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
/// SOFTWARE.
|
||||
|
||||
/// @brief defines an unsupported register
|
||||
pub const BF_REG_T_UNSUPPORTED: u64 = 0;
|
||||
/// @brief defines the rax register
|
||||
const BF_REG_T_RAX:u64 = 1;
|
||||
pub const BF_REG_T_RAX: u64 = 1;
|
||||
/// @brief defines the rbx register
|
||||
const BF_REG_T_RBX:u64 = 2;
|
||||
pub const BF_REG_T_RBX: u64 = 2;
|
||||
/// @brief defines the rcx register
|
||||
const BF_REG_T_RCX:u64 = 3;
|
||||
pub const BF_REG_T_RCX: u64 = 3;
|
||||
/// @brief defines the rdx register
|
||||
const BF_REG_T_RDX:u64 = 4;
|
||||
pub const BF_REG_T_RDX: u64 = 4;
|
||||
/// @brief defines the rbp register
|
||||
const BF_REG_T_RBP:u64 = 5;
|
||||
pub const BF_REG_T_RBP: u64 = 5;
|
||||
/// @brief defines the rsi register
|
||||
const BF_REG_T_RSI:u64 = 6;
|
||||
pub const BF_REG_T_RSI: u64 = 6;
|
||||
/// @brief defines the rdi register
|
||||
const BF_REG_T_RDI:u64 = 7;
|
||||
pub const BF_REG_T_RDI: u64 = 7;
|
||||
/// @brief defines the r8 register
|
||||
const BF_REG_T_R8:u64 = 8;
|
||||
pub const BF_REG_T_R8: u64 = 8;
|
||||
/// @brief defines the r9 register
|
||||
const BF_REG_T_R9:u64 = 9;
|
||||
pub const BF_REG_T_R9: u64 = 9;
|
||||
/// @brief defines the r10 register
|
||||
const BF_REG_T_R10:u64 = 10;
|
||||
pub const BF_REG_T_R10: u64 = 10;
|
||||
/// @brief defines the r11 register
|
||||
const BF_REG_T_R11:u64 = 11;
|
||||
pub const BF_REG_T_R11: u64 = 11;
|
||||
/// @brief defines the r12 register
|
||||
const BF_REG_T_R12:u64 = 12;
|
||||
pub const BF_REG_T_R12: u64 = 12;
|
||||
/// @brief defines the r13 register
|
||||
const BF_REG_T_R13:u64 = 13;
|
||||
pub const BF_REG_T_R13: u64 = 13;
|
||||
/// @brief defines the r14 register
|
||||
const BF_REG_T_R14:u64 = 14;
|
||||
pub const BF_REG_T_R14: u64 = 14;
|
||||
/// @brief defines the r15 register
|
||||
const BF_REG_T_R15:u64 = 15;
|
||||
/// @brief defines the bf_reg_t_guest_cr2 register
|
||||
const BF_REG_T_GUEST_CR2:u64 = 16;
|
||||
/// @brief defines the bf_reg_t_guest_dr6 register
|
||||
const BF_REG_T_GUEST_DR6:u64 = 17;
|
||||
/// @brief defines the bf_reg_t_guest_star register
|
||||
const BF_REG_T_GUEST_STAR:u64 = 18;
|
||||
/// @brief defines the bf_reg_t_guest_lstar register
|
||||
const BF_REG_T_GUEST_LSTAR:u64 = 19;
|
||||
/// @brief defines the bf_reg_t_guest_cstar register
|
||||
const BF_REG_T_GUEST_CSTAR:u64 = 20;
|
||||
/// @brief defines the bf_reg_t_guest_fmask register
|
||||
const BF_REG_T_GUEST_FMASK:u64 = 21;
|
||||
/// @brief defines the bf_reg_t_guest_kernel_gs_base register
|
||||
const BF_REG_T_GUEST_KERNEL_GS_BASE:u64 = 22;
|
||||
pub const BF_REG_T_R15: u64 = 15;
|
||||
/// @brief defines the cr2 register
|
||||
pub const BF_REG_T_CR2: u64 = 16;
|
||||
/// @brief defines the dr6 register
|
||||
pub const BF_REG_T_DR6: u64 = 17;
|
||||
/// @brief defines the star register
|
||||
pub const BF_REG_T_STAR: u64 = 18;
|
||||
/// @brief defines the lstar register
|
||||
pub const BF_REG_T_LSTAR: u64 = 19;
|
||||
/// @brief defines the cstar register
|
||||
pub const BF_REG_T_CSTAR: u64 = 20;
|
||||
/// @brief defines the fmask register
|
||||
pub const BF_REG_T_FMASK: u64 = 21;
|
||||
/// @brief defines the kernel_gs_base register
|
||||
pub const BF_REG_T_KERNEL_GS_BASE: u64 = 22;
|
||||
/// @brief defines the virtual_processor_identifier register
|
||||
const BF_REG_T_VIRTUAL_PROCESSOR_IDENTIFIER:u64 = 23;
|
||||
pub const BF_REG_T_VIRTUAL_PROCESSOR_IDENTIFIER: u64 = 23;
|
||||
/// @brief defines the posted_interrupt_notification_vector register
|
||||
const BF_REG_T_POSTED_INTERRUPT_NOTIFICATION_VECTOR:u64 = 24;
|
||||
pub const BF_REG_T_POSTED_INTERRUPT_NOTIFICATION_VECTOR: u64 = 24;
|
||||
/// @brief defines the eptp_index register
|
||||
const BF_REG_T_EPTP_INDEX:u64 = 25;
|
||||
pub const BF_REG_T_EPTP_INDEX: u64 = 25;
|
||||
/// @brief defines the guest_es_selector register
|
||||
const BF_REG_T_GUEST_ES_SELECTOR:u64 = 26;
|
||||
pub const BF_REG_T_ES_SELECTOR: u64 = 26;
|
||||
/// @brief defines the guest_cs_selector register
|
||||
const BF_REG_T_GUEST_CS_SELECTOR:u64 = 27;
|
||||
pub const BF_REG_T_CS_SELECTOR: u64 = 27;
|
||||
/// @brief defines the guest_ss_selector register
|
||||
const BF_REG_T_GUEST_SS_SELECTOR:u64 = 28;
|
||||
pub const BF_REG_T_SS_SELECTOR: u64 = 28;
|
||||
/// @brief defines the guest_ds_selector register
|
||||
const BF_REG_T_GUEST_DS_SELECTOR:u64 = 29;
|
||||
pub const BF_REG_T_DS_SELECTOR: u64 = 29;
|
||||
/// @brief defines the guest_fs_selector register
|
||||
const BF_REG_T_GUEST_FS_SELECTOR:u64 = 30;
|
||||
pub const BF_REG_T_FS_SELECTOR: u64 = 30;
|
||||
/// @brief defines the guest_gs_selector register
|
||||
const BF_REG_T_GUEST_GS_SELECTOR:u64 = 31;
|
||||
pub const BF_REG_T_GS_SELECTOR: u64 = 31;
|
||||
/// @brief defines the guest_ldtr_selector register
|
||||
const BF_REG_T_GUEST_LDTR_SELECTOR:u64 = 32;
|
||||
pub const BF_REG_T_LDTR_SELECTOR: u64 = 32;
|
||||
/// @brief defines the guest_tr_selector register
|
||||
const BF_REG_T_GUEST_TR_SELECTOR:u64 = 33;
|
||||
pub const BF_REG_T_TR_SELECTOR: u64 = 33;
|
||||
/// @brief defines the guest_interrupt_status register
|
||||
const BF_REG_T_GUEST_INTERRUPT_STATUS:u64 = 34;
|
||||
pub const BF_REG_T_INTERRUPT_STATUS: u64 = 34;
|
||||
/// @brief defines the pml_index register
|
||||
const BF_REG_T_PML_INDEX:u64 = 35;
|
||||
pub const BF_REG_T_PML_INDEX: u64 = 35;
|
||||
/// @brief defines the address_of_io_bitmap_a register
|
||||
const BF_REG_T_ADDRESS_OF_IO_BITMAP_A:u64 = 36;
|
||||
pub const BF_REG_T_ADDRESS_OF_IO_BITMAP_A: u64 = 36;
|
||||
/// @brief defines the address_of_io_bitmap_b register
|
||||
const BF_REG_T_ADDRESS_OF_IO_BITMAP_B:u64 = 37;
|
||||
pub const BF_REG_T_ADDRESS_OF_IO_BITMAP_B: u64 = 37;
|
||||
/// @brief defines the address_of_msr_bitmaps register
|
||||
const BF_REG_T_ADDRESS_OF_MSR_BITMAPS:u64 = 38;
|
||||
pub const BF_REG_T_ADDRESS_OF_MSR_BITMAPS: u64 = 38;
|
||||
/// @brief defines the vmexit_msr_store_address register
|
||||
const BF_REG_T_VMEXIT_MSR_STORE_ADDRESS:u64 = 39;
|
||||
pub const BF_REG_T_VMEXIT_MSR_STORE_ADDRESS: u64 = 39;
|
||||
/// @brief defines the vmexit_msr_load_address register
|
||||
const BF_REG_T_VMEXIT_MSR_LOAD_ADDRESS:u64 = 40;
|
||||
pub const BF_REG_T_VMEXIT_MSR_LOAD_ADDRESS: u64 = 40;
|
||||
/// @brief defines the vmentry_msr_load_address register
|
||||
const BF_REG_T_VMENTRY_MSR_LOAD_ADDRESS:u64 = 41;
|
||||
pub const BF_REG_T_VMENTRY_MSR_LOAD_ADDRESS: u64 = 41;
|
||||
/// @brief defines the executive_vmcs_pointer register
|
||||
const BF_REG_T_EXECUTIVE_VMCS_POINTER:u64 = 42;
|
||||
pub const BF_REG_T_EXECUTIVE_VMCS_POINTER: u64 = 42;
|
||||
/// @brief defines the pml_address register
|
||||
const BF_REG_T_PML_ADDRESS:u64 = 43;
|
||||
pub const BF_REG_T_PML_ADDRESS: u64 = 43;
|
||||
/// @brief defines the tsc_offset register
|
||||
const BF_REG_T_TSC_OFFSET:u64 = 44;
|
||||
pub const BF_REG_T_TSC_OFFSET: u64 = 44;
|
||||
/// @brief defines the virtual_apic_address register
|
||||
const BF_REG_T_VIRTUAL_APIC_ADDRESS:u64 = 45;
|
||||
pub const BF_REG_T_VIRTUAL_APIC_ADDRESS: u64 = 45;
|
||||
/// @brief defines the apic_access_address register
|
||||
const BF_REG_T_APIC_ACCESS_ADDRESS:u64 = 46;
|
||||
pub const BF_REG_T_APIC_ACCESS_ADDRESS: u64 = 46;
|
||||
/// @brief defines the posted_interrupt_descriptor_address register
|
||||
const BF_REG_T_POSTED_INTERRUPT_DESCRIPTOR_ADDRESS:u64 = 47;
|
||||
pub const BF_REG_T_POSTED_INTERRUPT_DESCRIPTOR_ADDRESS: u64 = 47;
|
||||
/// @brief defines the vm_function_controls register
|
||||
const BF_REG_T_VM_FUNCTION_CONTROLS:u64 = 48;
|
||||
pub const BF_REG_T_VM_FUNCTION_CONTROLS: u64 = 48;
|
||||
/// @brief defines the ept_pointer register
|
||||
const BF_REG_T_EPT_POINTER:u64 = 49;
|
||||
pub const BF_REG_T_EPT_POINTER: u64 = 49;
|
||||
/// @brief defines the eoi_exit_bitmap0 register
|
||||
const BF_REG_T_EOI_EXIT_BITMAP0:u64 = 50;
|
||||
pub const BF_REG_T_EOI_EXIT_BITMAP0: u64 = 50;
|
||||
/// @brief defines the eoi_exit_bitmap1 register
|
||||
const BF_REG_T_EOI_EXIT_BITMAP1:u64 = 51;
|
||||
pub const BF_REG_T_EOI_EXIT_BITMAP1: u64 = 51;
|
||||
/// @brief defines the eoi_exit_bitmap2 register
|
||||
const BF_REG_T_EOI_EXIT_BITMAP2:u64 = 52;
|
||||
pub const BF_REG_T_EOI_EXIT_BITMAP2: u64 = 52;
|
||||
/// @brief defines the eoi_exit_bitmap3 register
|
||||
const BF_REG_T_EOI_EXIT_BITMAP3:u64 = 53;
|
||||
pub const BF_REG_T_EOI_EXIT_BITMAP3: u64 = 53;
|
||||
/// @brief defines the eptp_list_address register
|
||||
const BF_REG_T_EPTP_LIST_ADDRESS:u64 = 54;
|
||||
pub const BF_REG_T_EPTP_LIST_ADDRESS: u64 = 54;
|
||||
/// @brief defines the vmread_bitmap_address register
|
||||
const BF_REG_T_VMREAD_BITMAP_ADDRESS:u64 = 55;
|
||||
pub const BF_REG_T_VMREAD_BITMAP_ADDRESS: u64 = 55;
|
||||
/// @brief defines the vmwrite_bitmap_address register
|
||||
const BF_REG_T_VMWRITE_BITMAP_ADDRESS:u64 = 56;
|
||||
pub const BF_REG_T_VMWRITE_BITMAP_ADDRESS: u64 = 56;
|
||||
/// @brief defines the virt_exception_information_address register
|
||||
const BF_REG_T_VIRT_EXCEPTION_INFORMATION_ADDRESS:u64 = 57;
|
||||
pub const BF_REG_T_VIRT_EXCEPTION_INFORMATION_ADDRESS: u64 = 57;
|
||||
/// @brief defines the xss_exiting_bitmap register
|
||||
const BF_REG_T_XSS_EXITING_BITMAP:u64 = 58;
|
||||
pub const BF_REG_T_XSS_EXITING_BITMAP: u64 = 58;
|
||||
/// @brief defines the encls_exiting_bitmap register
|
||||
const BF_REG_T_ENCLS_EXITING_BITMAP:u64 = 59;
|
||||
pub const BF_REG_T_ENCLS_EXITING_BITMAP: u64 = 59;
|
||||
/// @brief defines the sub_page_permission_table_pointer register
|
||||
const BF_REG_T_SUB_PAGE_PERMISSION_TABLE_POINTER:u64 = 60;
|
||||
/// @brief defines the tls_multiplier register
|
||||
const BF_REG_T_TLS_MULTIPLIER:u64 = 61;
|
||||
pub const BF_REG_T_SUB_PAGE_PERMISSION_TABLE_POINTER: u64 = 60;
|
||||
/// @brief defines the tsc_multiplier register
|
||||
pub const BF_REG_T_TSC_MULTIPLIER: u64 = 61;
|
||||
/// @brief defines the guest_physical_address register
|
||||
const BF_REG_T_GUEST_PHYSICAL_ADDRESS:u64 = 62;
|
||||
pub const BF_REG_T_PHYSICAL_ADDRESS: u64 = 62;
|
||||
/// @brief defines the vmcs_link_pointer register
|
||||
const BF_REG_T_VMCS_LINK_POINTER:u64 = 63;
|
||||
pub const BF_REG_T_VMCS_LINK_POINTER: u64 = 63;
|
||||
/// @brief defines the guest_debugctl register
|
||||
const BF_REG_T_GUEST_DEBUGCTL:u64 = 64;
|
||||
pub const BF_REG_T_DEBUGCTL: u64 = 64;
|
||||
/// @brief defines the guest_pat register
|
||||
const BF_REG_T_GUEST_PAT:u64 = 65;
|
||||
pub const BF_REG_T_PAT: u64 = 65;
|
||||
/// @brief defines the guest_efer register
|
||||
const BF_REG_T_GUEST_EFER:u64 = 66;
|
||||
pub const BF_REG_T_EFER: u64 = 66;
|
||||
/// @brief defines the guest_perf_global_ctrl register
|
||||
const BF_REG_T_GUEST_PERF_GLOBAL_CTRL:u64 = 67;
|
||||
pub const BF_REG_T_PERF_GLOBAL_CTRL: u64 = 67;
|
||||
/// @brief defines the guest_pdpte0 register
|
||||
const BF_REG_T_GUEST_PDPTE0:u64 = 68;
|
||||
pub const BF_REG_T_PDPTE0: u64 = 68;
|
||||
/// @brief defines the guest_pdpte1 register
|
||||
const BF_REG_T_GUEST_PDPTE1:u64 = 69;
|
||||
pub const BF_REG_T_PDPTE1: u64 = 69;
|
||||
/// @brief defines the guest_pdpte2 register
|
||||
const BF_REG_T_GUEST_PDPTE2:u64 = 70;
|
||||
pub const BF_REG_T_PDPTE2: u64 = 70;
|
||||
/// @brief defines the guest_pdpte3 register
|
||||
const BF_REG_T_GUEST_PDPTE3:u64 = 71;
|
||||
pub const BF_REG_T_PDPTE3: u64 = 71;
|
||||
/// @brief defines the guest_bndcfgs register
|
||||
const BF_REG_T_GUEST_BNDCFGS:u64 = 72;
|
||||
pub const BF_REG_T_BNDCFGS: u64 = 72;
|
||||
/// @brief defines the guest_rtit_ctl register
|
||||
const BF_REG_T_GUEST_RTIT_CTL:u64 = 73;
|
||||
pub const BF_REG_T_RTIT_CTL: u64 = 73;
|
||||
/// @brief defines the pin_based_vm_execution_ctls register
|
||||
const BF_REG_T_PIN_BASED_VM_EXECUTION_CTLS:u64 = 74;
|
||||
pub const BF_REG_T_PIN_BASED_VM_EXECUTION_CTLS: u64 = 74;
|
||||
/// @brief defines the primary_proc_based_vm_execution_ctls register
|
||||
const BF_REG_T_PRIMARY_PROC_BASED_VM_EXECUTION_CTLS:u64 = 75;
|
||||
pub const BF_REG_T_PRIMARY_PROC_BASED_VM_EXECUTION_CTLS: u64 = 75;
|
||||
/// @brief defines the exception_bitmap register
|
||||
const BF_REG_T_EXCEPTION_BITMAP:u64 = 76;
|
||||
pub const BF_REG_T_EXCEPTION_BITMAP: u64 = 76;
|
||||
/// @brief defines the page_fault_error_code_mask register
|
||||
const BF_REG_T_PAGE_FAULT_ERROR_CODE_MASK:u64 = 77;
|
||||
pub const BF_REG_T_PAGE_FAULT_ERROR_CODE_MASK: u64 = 77;
|
||||
/// @brief defines the page_fault_error_code_match register
|
||||
const BF_REG_T_PAGE_FAULT_ERROR_CODE_MATCH:u64 = 78;
|
||||
pub const BF_REG_T_PAGE_FAULT_ERROR_CODE_MATCH: u64 = 78;
|
||||
/// @brief defines the cr3_target_count register
|
||||
const BF_REG_T_CR3_TARGET_COUNT:u64 = 79;
|
||||
pub const BF_REG_T_CR3_TARGET_COUNT: u64 = 79;
|
||||
/// @brief defines the vmexit_ctls register
|
||||
const BF_REG_T_VMEXIT_CTLS:u64 = 80;
|
||||
pub const BF_REG_T_VMEXIT_CTLS: u64 = 80;
|
||||
/// @brief defines the vmexit_msr_store_count register
|
||||
const BF_REG_T_VMEXIT_MSR_STORE_COUNT:u64 = 81;
|
||||
pub const BF_REG_T_VMEXIT_MSR_STORE_COUNT: u64 = 81;
|
||||
/// @brief defines the vmexit_msr_load_count register
|
||||
const BF_REG_T_VMEXIT_MSR_LOAD_COUNT:u64 = 82;
|
||||
pub const BF_REG_T_VMEXIT_MSR_LOAD_COUNT: u64 = 82;
|
||||
/// @brief defines the vmentry_ctls register
|
||||
const BF_REG_T_VMENTRY_CTLS:u64 = 83;
|
||||
pub const BF_REG_T_VMENTRY_CTLS: u64 = 83;
|
||||
/// @brief defines the vmentry_msr_load_count register
|
||||
const BF_REG_T_VMENTRY_MSR_LOAD_COUNT:u64 = 84;
|
||||
pub const BF_REG_T_VMENTRY_MSR_LOAD_COUNT: u64 = 84;
|
||||
/// @brief defines the vmentry_interrupt_information_field register
|
||||
const BF_REG_T_VMENTRY_INTERRUPT_INFORMATION_FIELD:u64 = 85;
|
||||
pub const BF_REG_T_VMENTRY_INTERRUPT_INFORMATION_FIELD: u64 = 85;
|
||||
/// @brief defines the vmentry_exception_error_code register
|
||||
const BF_REG_T_VMENTRY_EXCEPTION_ERROR_CODE:u64 = 86;
|
||||
pub const BF_REG_T_VMENTRY_EXCEPTION_ERROR_CODE: u64 = 86;
|
||||
/// @brief defines the vmentry_instruction_length register
|
||||
const BF_REG_T_VMENTRY_INSTRUCTION_LENGTH:u64 = 87;
|
||||
pub const BF_REG_T_VMENTRY_INSTRUCTION_LENGTH: u64 = 87;
|
||||
/// @brief defines the tpr_threshold register
|
||||
const BF_REG_T_TPR_THRESHOLD:u64 = 88;
|
||||
pub const BF_REG_T_TPR_THRESHOLD: u64 = 88;
|
||||
/// @brief defines the secondary_proc_based_vm_execution_ctls register
|
||||
const BF_REG_T_SECONDARY_PROC_BASED_VM_EXECUTION_CTLS:u64 = 89;
|
||||
pub const BF_REG_T_SECONDARY_PROC_BASED_VM_EXECUTION_CTLS: u64 = 89;
|
||||
/// @brief defines the ple_gap register
|
||||
const BF_REG_T_PLE_GAP:u64 = 90;
|
||||
pub const BF_REG_T_PLE_GAP: u64 = 90;
|
||||
/// @brief defines the ple_window register
|
||||
const BF_REG_T_PLE_WINDOW:u64 = 91;
|
||||
pub const BF_REG_T_PLE_WINDOW: u64 = 91;
|
||||
/// @brief defines the vm_instruction_error register
|
||||
const BF_REG_T_VM_INSTRUCTION_ERROR:u64 = 92;
|
||||
pub const BF_REG_T_VM_INSTRUCTION_ERROR: u64 = 92;
|
||||
/// @brief defines the exit_reason register
|
||||
const BF_REG_T_EXIT_REASON:u64 = 93;
|
||||
pub const BF_REG_T_EXIT_REASON: u64 = 93;
|
||||
/// @brief defines the vmexit_interruption_information register
|
||||
const BF_REG_T_VMEXIT_INTERRUPTION_INFORMATION:u64 = 94;
|
||||
pub const BF_REG_T_VMEXIT_INTERRUPTION_INFORMATION: u64 = 94;
|
||||
/// @brief defines the vmexit_interruption_error_code register
|
||||
const BF_REG_T_VMEXIT_INTERRUPTION_ERROR_CODE:u64 = 95;
|
||||
pub const BF_REG_T_VMEXIT_INTERRUPTION_ERROR_CODE: u64 = 95;
|
||||
/// @brief defines the idt_vectoring_information_field register
|
||||
const BF_REG_T_IDT_VECTORING_INFORMATION_FIELD:u64 = 96;
|
||||
pub const BF_REG_T_IDT_VECTORING_INFORMATION_FIELD: u64 = 96;
|
||||
/// @brief defines the idt_vectoring_error_code register
|
||||
const BF_REG_T_IDT_VECTORING_ERROR_CODE:u64 = 97;
|
||||
pub const BF_REG_T_IDT_VECTORING_ERROR_CODE: u64 = 97;
|
||||
/// @brief defines the vmexit_instruction_length register
|
||||
const BF_REG_T_VMEXIT_INSTRUCTION_LENGTH:u64 = 98;
|
||||
pub const BF_REG_T_VMEXIT_INSTRUCTION_LENGTH: u64 = 98;
|
||||
/// @brief defines the vmexit_instruction_information register
|
||||
const BF_REG_T_VMEXIT_INSTRUCTION_INFORMATION:u64 = 99;
|
||||
pub const BF_REG_T_VMEXIT_INSTRUCTION_INFORMATION: u64 = 99;
|
||||
/// @brief defines the guest_es_limit register
|
||||
const BF_REG_T_GUEST_ES_LIMIT:u64 = 100;
|
||||
pub const BF_REG_T_ES_LIMIT: u64 = 100;
|
||||
/// @brief defines the guest_cs_limit register
|
||||
const BF_REG_T_GUEST_CS_LIMIT:u64 = 101;
|
||||
pub const BF_REG_T_CS_LIMIT: u64 = 101;
|
||||
/// @brief defines the guest_ss_limit register
|
||||
const BF_REG_T_GUEST_SS_LIMIT:u64 = 102;
|
||||
pub const BF_REG_T_SS_LIMIT: u64 = 102;
|
||||
/// @brief defines the guest_ds_limit register
|
||||
const BF_REG_T_GUEST_DS_LIMIT:u64 = 103;
|
||||
pub const BF_REG_T_DS_LIMIT: u64 = 103;
|
||||
/// @brief defines the guest_fs_limit register
|
||||
const BF_REG_T_GUEST_FS_LIMIT:u64 = 104;
|
||||
pub const BF_REG_T_FS_LIMIT: u64 = 104;
|
||||
/// @brief defines the guest_gs_limit register
|
||||
const BF_REG_T_GUEST_GS_LIMIT:u64 = 105;
|
||||
pub const BF_REG_T_GS_LIMIT: u64 = 105;
|
||||
/// @brief defines the guest_ldtr_limit register
|
||||
const BF_REG_T_GUEST_LDTR_LIMIT:u64 = 106;
|
||||
pub const BF_REG_T_LDTR_LIMIT: u64 = 106;
|
||||
/// @brief defines the guest_tr_limit register
|
||||
const BF_REG_T_GUEST_TR_LIMIT:u64 = 107;
|
||||
pub const BF_REG_T_TR_LIMIT: u64 = 107;
|
||||
/// @brief defines the guest_gdtr_limit register
|
||||
const BF_REG_T_GUEST_GDTR_LIMIT:u64 = 108;
|
||||
pub const BF_REG_T_GDTR_LIMIT: u64 = 108;
|
||||
/// @brief defines the guest_idtr_limit register
|
||||
const BF_REG_T_GUEST_IDTR_LIMIT:u64 = 109;
|
||||
/// @brief defines the guest_es_access_rights register
|
||||
const BF_REG_T_GUEST_ES_ACCESS_RIGHTS:u64 = 110;
|
||||
/// @brief defines the guest_cs_access_rights register
|
||||
const BF_REG_T_GUEST_CS_ACCESS_RIGHTS:u64 = 111;
|
||||
/// @brief defines the guest_ss_access_rights register
|
||||
const BF_REG_T_GUEST_SS_ACCESS_RIGHTS:u64 = 112;
|
||||
/// @brief defines the guest_ds_access_rights register
|
||||
const BF_REG_T_GUEST_DS_ACCESS_RIGHTS:u64 = 113;
|
||||
/// @brief defines the guest_fs_access_rights register
|
||||
const BF_REG_T_GUEST_FS_ACCESS_RIGHTS:u64 = 114;
|
||||
/// @brief defines the guest_gs_access_rights register
|
||||
const BF_REG_T_GUEST_GS_ACCESS_RIGHTS:u64 = 115;
|
||||
/// @brief defines the guest_ldtr_access_rights register
|
||||
const BF_REG_T_GUEST_LDTR_ACCESS_RIGHTS:u64 = 116;
|
||||
/// @brief defines the guest_tr_access_rights register
|
||||
const BF_REG_T_GUEST_TR_ACCESS_RIGHTS:u64 = 117;
|
||||
pub const BF_REG_T_IDTR_LIMIT: u64 = 109;
|
||||
/// @brief defines the guest_es_attrib register
|
||||
pub const BF_REG_T_ES_ATTRIB: u64 = 110;
|
||||
/// @brief defines the guest_cs_attrib register
|
||||
pub const BF_REG_T_CS_ATTRIB: u64 = 111;
|
||||
/// @brief defines the guest_ss_attrib register
|
||||
pub const BF_REG_T_SS_ATTRIB: u64 = 112;
|
||||
/// @brief defines the guest_ds_attrib register
|
||||
pub const BF_REG_T_DS_ATTRIB: u64 = 113;
|
||||
/// @brief defines the guest_fs_attrib register
|
||||
pub const BF_REG_T_FS_ATTRIB: u64 = 114;
|
||||
/// @brief defines the guest_gs_attrib register
|
||||
pub const BF_REG_T_GS_ATTRIB: u64 = 115;
|
||||
/// @brief defines the guest_ldtr_attrib register
|
||||
pub const BF_REG_T_LDTR_ATTRIB: u64 = 116;
|
||||
/// @brief defines the guest_tr_attrib register
|
||||
pub const BF_REG_T_TR_ATTRIB: u64 = 117;
|
||||
/// @brief defines the guest_interruptibility_state register
|
||||
const BF_REG_T_GUEST_INTERRUPTIBILITY_STATE:u64 = 118;
|
||||
pub const BF_REG_T_INTERRUPTIBILITY_STATE: u64 = 118;
|
||||
/// @brief defines the guest_activity_state register
|
||||
const BF_REG_T_GUEST_ACTIVITY_STATE:u64 = 119;
|
||||
pub const BF_REG_T_ACTIVITY_STATE: u64 = 119;
|
||||
/// @brief defines the guest_smbase register
|
||||
const BF_REG_T_GUEST_SMBASE:u64 = 120;
|
||||
pub const BF_REG_T_SMBASE: u64 = 120;
|
||||
/// @brief defines the guest_sysenter_cs register
|
||||
const BF_REG_T_GUEST_SYSENTER_CS:u64 = 121;
|
||||
pub const BF_REG_T_SYSENTER_CS: u64 = 121;
|
||||
/// @brief defines the vmx_preemption_timer_value register
|
||||
const BF_REG_T_VMX_PREEMPTION_TIMER_VALUE:u64 = 122;
|
||||
pub const BF_REG_T_VMX_PREEMPTION_TIMER_VALUE: u64 = 122;
|
||||
/// @brief defines the cr0_guest_host_mask register
|
||||
const BF_REG_T_CR0_GUEST_HOST_MASK:u64 = 123;
|
||||
pub const BF_REG_T_CR0_GUEST_HOST_MASK: u64 = 123;
|
||||
/// @brief defines the cr4_guest_host_mask register
|
||||
const BF_REG_T_CR4_GUEST_HOST_MASK:u64 = 124;
|
||||
pub const BF_REG_T_CR4_GUEST_HOST_MASK: u64 = 124;
|
||||
/// @brief defines the cr0_read_shadow register
|
||||
const BF_REG_T_CR0_READ_SHADOW:u64 = 125;
|
||||
pub const BF_REG_T_CR0_READ_SHADOW: u64 = 125;
|
||||
/// @brief defines the cr4_read_shadow register
|
||||
const BF_REG_T_CR4_READ_SHADOW:u64 = 126;
|
||||
pub const BF_REG_T_CR4_READ_SHADOW: u64 = 126;
|
||||
/// @brief defines the cr3_target_value0 register
|
||||
const BF_REG_T_CR3_TARGET_VALUE0:u64 = 127;
|
||||
pub const BF_REG_T_CR3_TARGET_VALUE0: u64 = 127;
|
||||
/// @brief defines the cr3_target_value1 register
|
||||
const BF_REG_T_CR3_TARGET_VALUE1:u64 = 128;
|
||||
pub const BF_REG_T_CR3_TARGET_VALUE1: u64 = 128;
|
||||
/// @brief defines the cr3_target_value2 register
|
||||
const BF_REG_T_CR3_TARGET_VALUE2:u64 = 129;
|
||||
pub const BF_REG_T_CR3_TARGET_VALUE2: u64 = 129;
|
||||
/// @brief defines the cr3_target_value3 register
|
||||
const BF_REG_T_CR3_TARGET_VALUE3:u64 = 130;
|
||||
pub const BF_REG_T_CR3_TARGET_VALUE3: u64 = 130;
|
||||
/// @brief defines the exit_qualification register
|
||||
const BF_REG_T_EXIT_QUALIFICATION:u64 = 131;
|
||||
pub const BF_REG_T_EXIT_QUALIFICATION: u64 = 131;
|
||||
/// @brief defines the io_rcx register
|
||||
const BF_REG_T_IO_RCX:u64 = 132;
|
||||
pub const BF_REG_T_IO_RCX: u64 = 132;
|
||||
/// @brief defines the io_rsi register
|
||||
const BF_REG_T_IO_RSI:u64 = 133;
|
||||
pub const BF_REG_T_IO_RSI: u64 = 133;
|
||||
/// @brief defines the io_rdi register
|
||||
const BF_REG_T_IO_RDI:u64 = 134;
|
||||
pub const BF_REG_T_IO_RDI: u64 = 134;
|
||||
/// @brief defines the io_rip register
|
||||
const BF_REG_T_IO_RIP:u64 = 135;
|
||||
pub const BF_REG_T_IO_RIP: u64 = 135;
|
||||
/// @brief defines the guest_linear_address register
|
||||
const BF_REG_T_GUEST_LINEAR_ADDRESS:u64 = 136;
|
||||
pub const BF_REG_T_LINEAR_ADDRESS: u64 = 136;
|
||||
/// @brief defines the guest_cr0 register
|
||||
const BF_REG_T_GUEST_CR0:u64 = 137;
|
||||
pub const BF_REG_T_CR0: u64 = 137;
|
||||
/// @brief defines the guest_cr3 register
|
||||
const BF_REG_T_GUEST_CR3:u64 = 138;
|
||||
pub const BF_REG_T_CR3: u64 = 138;
|
||||
/// @brief defines the guest_cr4 register
|
||||
const BF_REG_T_GUEST_CR4:u64 = 139;
|
||||
pub const BF_REG_T_CR4: u64 = 139;
|
||||
/// @brief defines the guest_es_base register
|
||||
const BF_REG_T_GUEST_ES_BASE:u64 = 140;
|
||||
pub const BF_REG_T_ES_BASE: u64 = 140;
|
||||
/// @brief defines the guest_cs_base register
|
||||
const BF_REG_T_GUEST_CS_BASE:u64 = 141;
|
||||
pub const BF_REG_T_CS_BASE: u64 = 141;
|
||||
/// @brief defines the guest_ss_base register
|
||||
const BF_REG_T_GUEST_SS_BASE:u64 = 142;
|
||||
pub const BF_REG_T_SS_BASE: u64 = 142;
|
||||
/// @brief defines the guest_ds_base register
|
||||
const BF_REG_T_GUEST_DS_BASE:u64 = 143;
|
||||
pub const BF_REG_T_DS_BASE: u64 = 143;
|
||||
/// @brief defines the guest_fs_base register
|
||||
const BF_REG_T_GUEST_FS_BASE:u64 = 144;
|
||||
pub const BF_REG_T_FS_BASE: u64 = 144;
|
||||
/// @brief defines the guest_gs_base register
|
||||
const BF_REG_T_GUEST_GS_BASE:u64 = 145;
|
||||
pub const BF_REG_T_GS_BASE: u64 = 145;
|
||||
/// @brief defines the guest_ldtr_base register
|
||||
const BF_REG_T_GUEST_LDTR_BASE:u64 = 146;
|
||||
pub const BF_REG_T_LDTR_BASE: u64 = 146;
|
||||
/// @brief defines the guest_tr_base register
|
||||
const BF_REG_T_GUEST_TR_BASE:u64 = 147;
|
||||
pub const BF_REG_T_TR_BASE: u64 = 147;
|
||||
/// @brief defines the guest_gdtr_base register
|
||||
const BF_REG_T_GUEST_GDTR_BASE:u64 = 148;
|
||||
pub const BF_REG_T_GDTR_BASE: u64 = 148;
|
||||
/// @brief defines the guest_idtr_base register
|
||||
const BF_REG_T_GUEST_IDTR_BASE:u64 = 149;
|
||||
pub const BF_REG_T_IDTR_BASE: u64 = 149;
|
||||
/// @brief defines the guest_dr7 register
|
||||
const BF_REG_T_GUEST_DR7:u64 = 150;
|
||||
pub const BF_REG_T_DR7: u64 = 150;
|
||||
/// @brief defines the guest_rsp register
|
||||
const BF_REG_T_GUEST_RSP:u64 = 151;
|
||||
pub const BF_REG_T_RSP: u64 = 151;
|
||||
/// @brief defines the guest_rip register
|
||||
const BF_REG_T_GUEST_RIP:u64 = 152;
|
||||
pub const BF_REG_T_RIP: u64 = 152;
|
||||
/// @brief defines the guest_rflags register
|
||||
const BF_REG_T_GUEST_RFLAGS:u64 = 153;
|
||||
pub const BF_REG_T_RFLAGS: u64 = 153;
|
||||
/// @brief defines the guest_pending_debug_exceptions register
|
||||
const BF_REG_T_GUEST_PENDING_DEBUG_EXCEPTIONS:u64 = 154;
|
||||
pub const BF_REG_T_PENDING_DEBUG_EXCEPTIONS: u64 = 154;
|
||||
/// @brief defines the guest_sysenter_esp register
|
||||
const BF_REG_T_GUEST_SYSENTER_ESP:u64 = 155;
|
||||
pub const BF_REG_T_SYSENTER_ESP: u64 = 155;
|
||||
/// @brief defines the guest_sysenter_eip register
|
||||
const BF_REG_T_GUEST_SYSENTER_EIP:u64 = 156;
|
||||
pub const BF_REG_T_SYSENTER_EIP: u64 = 156;
|
||||
/// @brief defines the cr8 register
|
||||
pub const BF_REG_T_CR8: u64 = 157;
|
||||
/// @brief defines the dr0 register
|
||||
pub const BF_REG_T_DR0: u64 = 158;
|
||||
/// @brief defines the dr1 register
|
||||
pub const BF_REG_T_DR1: u64 = 159;
|
||||
/// @brief defines the dr2 register
|
||||
pub const BF_REG_T_DR2: u64 = 160;
|
||||
/// @brief defines the dr3 register
|
||||
pub const BF_REG_T_DR3: u64 = 161;
|
||||
/// @brief defines the xcr0 register
|
||||
pub const BF_REG_T_XCR0: u64 = 162;
|
||||
/// @brief defines an invalid register
|
||||
pub const BF_REG_T_INVALID: u64 = 163;
|
||||
|
|
|
|||
|
|
@ -21,3 +21,82 @@
|
|||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#![no_std]
|
||||
|
||||
#[macro_use]
|
||||
extern crate bsl;
|
||||
|
||||
#[path = "constants.rs"]
|
||||
#[doc(hidden)]
|
||||
pub mod constants;
|
||||
pub use constants::*;
|
||||
|
||||
#[path = "include/bf_types.rs"]
|
||||
#[doc(hidden)]
|
||||
pub mod bf_types;
|
||||
pub use bf_types::*;
|
||||
|
||||
#[path = "include/bf_constants.rs"]
|
||||
#[doc(hidden)]
|
||||
pub mod bf_constants;
|
||||
pub use bf_constants::*;
|
||||
|
||||
#[cfg(feature = "AuthenticAMD")]
|
||||
#[path = "include/x64/amd/bf_reg_t.rs"]
|
||||
#[doc(hidden)]
|
||||
pub mod bf_reg_t;
|
||||
|
||||
#[cfg(feature = "GenuineIntel")]
|
||||
#[path = "include/x64/intel/bf_reg_t.rs"]
|
||||
#[doc(hidden)]
|
||||
pub mod bf_reg_t;
|
||||
|
||||
pub use bf_reg_t::*;
|
||||
|
||||
#[path = "src/bf_syscall_impl.rs"]
|
||||
#[doc(hidden)]
|
||||
pub mod bf_syscall_impl;
|
||||
pub use bf_syscall_impl::*;
|
||||
|
||||
macro_rules! print_thread_id {
|
||||
($($arg:tt)*) => {
|
||||
unsafe {
|
||||
print!(
|
||||
" [{}{:04x}{}:{}{:04x}{}:{}{:04x}{}:{}{:04x}{}:{}{:04x}{}:{}US{}]",
|
||||
bsl::cyn,
|
||||
crate::bf_tls_extid_impl(),
|
||||
bsl::rst,
|
||||
bsl::cyn,
|
||||
crate::bf_tls_vmid_impl(),
|
||||
bsl::rst,
|
||||
bsl::cyn,
|
||||
crate::bf_tls_vpid_impl(),
|
||||
bsl::rst,
|
||||
bsl::cyn,
|
||||
crate::bf_tls_vsid_impl(),
|
||||
bsl::rst,
|
||||
bsl::cyn,
|
||||
crate::bf_tls_ppid_impl(),
|
||||
bsl::rst,
|
||||
bsl::blu,
|
||||
bsl::rst
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#[path = "src/bf_control_ops.rs"]
|
||||
#[doc(hidden)]
|
||||
pub mod bf_control_ops;
|
||||
pub use bf_control_ops::*;
|
||||
|
||||
#[path = "src/bf_debug_ops.rs"]
|
||||
#[doc(hidden)]
|
||||
pub mod bf_debug_ops;
|
||||
pub use bf_debug_ops::*;
|
||||
|
||||
#[path = "src/bf_syscall_t.rs"]
|
||||
#[doc(hidden)]
|
||||
pub mod bf_syscall_t;
|
||||
pub use bf_syscall_t::*;
|
||||
|
|
|
|||
|
|
@ -32,26 +32,6 @@ pub fn bf_control_op_exit() {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_bf_control_op_exit {
|
||||
static mut EXECUTED: bool = false;
|
||||
|
||||
#[no_mangle]
|
||||
fn bf_control_op_exit_impl() {
|
||||
unsafe {
|
||||
EXECUTED = true;
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_bf_control_op_exit() {
|
||||
super::bf_control_op_exit();
|
||||
unsafe {
|
||||
assert!(EXECUTED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief This syscall tells the microkernel that the extension would
|
||||
/// like to wait for a callback. This is a blocking syscall that never
|
||||
|
|
@ -64,22 +44,14 @@ pub fn bf_control_op_wait() {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_bf_control_op_wait {
|
||||
static mut EXECUTED: bool = false;
|
||||
|
||||
#[no_mangle]
|
||||
fn bf_control_op_wait_impl() {
|
||||
unsafe {
|
||||
EXECUTED = true;
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_bf_control_op_wait() {
|
||||
super::bf_control_op_wait();
|
||||
unsafe {
|
||||
assert!(EXECUTED);
|
||||
}
|
||||
/// <!-- description -->
|
||||
/// @brief This syscall tells the microkernel that the extension would
|
||||
/// like to try again from a fast fail callback. This syscall is a
|
||||
/// blocking syscall that never returns and should be used to return
|
||||
/// from the fail_entry function.
|
||||
///
|
||||
pub fn bf_control_op_again() {
|
||||
unsafe {
|
||||
crate::bf_syscall_impl::bf_control_op_again_impl();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,8 +21,6 @@
|
|||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
/// SOFTWARE.
|
||||
use crate::types::BfCharT;
|
||||
use crate::types::BfCstrT;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief This syscall tells the microkernel to output reg0 and reg1 to
|
||||
|
|
@ -33,32 +31,9 @@ use crate::types::BfCstrT;
|
|||
/// @param val1 The first value to output to the microkernel's console
|
||||
/// @param val2 The second value to output to the microkernel's console
|
||||
///
|
||||
pub fn bf_debug_op_out(val1: u64, val2: u64) {
|
||||
pub fn bf_debug_op_out(val1: bsl::SafeU64, val2: bsl::SafeU64) {
|
||||
unsafe {
|
||||
crate::bf_syscall_impl::bf_debug_op_out_impl(val1, val2);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_bf_debug_op_out {
|
||||
static mut VAL1: u64 = 0;
|
||||
static mut VAL2: u64 = 0;
|
||||
|
||||
#[no_mangle]
|
||||
fn bf_debug_op_out_impl(val1: u64, val2: u64) {
|
||||
unsafe {
|
||||
VAL1 = val1;
|
||||
VAL2 = val2;
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_bf_debug_op_out() {
|
||||
super::bf_debug_op_out(23, 42);
|
||||
unsafe {
|
||||
assert!(VAL1 == 23);
|
||||
assert!(VAL2 == 42);
|
||||
}
|
||||
crate::bf_debug_op_out_impl(val1.get(), val2.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -70,29 +45,9 @@ mod test_bf_debug_op_out {
|
|||
/// <!-- inputs/outputs -->
|
||||
/// @param vmid The ID of the VM whose state is to be outputted
|
||||
///
|
||||
pub fn bf_debug_op_dump_vm(vmid: u16) {
|
||||
pub fn bf_debug_op_dump_vm(vmid: bsl::SafeU16) {
|
||||
unsafe {
|
||||
crate::bf_syscall_impl::bf_debug_op_dump_vm_impl(vmid);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_bf_debug_op_dump_vm {
|
||||
static mut ID: u64 = 0;
|
||||
|
||||
#[no_mangle]
|
||||
fn bf_debug_op_dump_vm_impl(vmid: u64) {
|
||||
unsafe {
|
||||
ID = vmid;
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_bf_debug_op_dump_vm() {
|
||||
super::bf_debug_op_dump_vm(42);
|
||||
unsafe {
|
||||
assert!(ID == 42);
|
||||
}
|
||||
crate::bf_debug_op_dump_vm_impl(vmid.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -104,29 +59,9 @@ mod test_bf_debug_op_dump_vm {
|
|||
/// <!-- inputs/outputs -->
|
||||
/// @param vpid The ID of the VP whose state is to be outputted
|
||||
///
|
||||
pub fn bf_debug_op_dump_vp(vpid: u16) {
|
||||
pub fn bf_debug_op_dump_vp(vpid: bsl::SafeU16) {
|
||||
unsafe {
|
||||
crate::bf_syscall_impl::bf_debug_op_dump_vp_impl(vpid);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_bf_debug_op_dump_vp {
|
||||
static mut ID: u64 = 0;
|
||||
|
||||
#[no_mangle]
|
||||
fn bf_debug_op_dump_vp_impl(vpid: u64) {
|
||||
unsafe {
|
||||
ID = vpid;
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_bf_debug_op_dump_vp() {
|
||||
super::bf_debug_op_dump_vp(42);
|
||||
unsafe {
|
||||
assert!(ID == 42);
|
||||
}
|
||||
crate::bf_debug_op_dump_vp_impl(vpid.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -138,29 +73,9 @@ mod test_bf_debug_op_dump_vp {
|
|||
/// <!-- inputs/outputs -->
|
||||
/// @param vsid The ID of the VS whose state is to be outputted
|
||||
///
|
||||
pub fn bf_debug_op_dump_vs(vsid: u16) {
|
||||
pub fn bf_debug_op_dump_vs(vsid: bsl::SafeU16) {
|
||||
unsafe {
|
||||
crate::bf_syscall_impl::bf_debug_op_dump_vs_impl(vsid);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_bf_debug_op_dump_vs {
|
||||
static mut ID: u64 = 0;
|
||||
|
||||
#[no_mangle]
|
||||
fn bf_debug_op_dump_vs_impl(vsid: u64) {
|
||||
unsafe {
|
||||
ID = vsid;
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_bf_debug_op_dump_vs() {
|
||||
super::bf_debug_op_dump_vs(42);
|
||||
unsafe {
|
||||
assert!(ID == 42);
|
||||
}
|
||||
crate::bf_debug_op_dump_vs_impl(vsid.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -172,29 +87,9 @@ mod test_bf_debug_op_dump_vs {
|
|||
/// <!-- inputs/outputs -->
|
||||
/// @param ppid The PPID of the PP to dump the log from
|
||||
///
|
||||
pub fn bf_debug_op_dump_vmexit_log(ppid: u16) {
|
||||
pub fn bf_debug_op_dump_vmexit_log(ppid: bsl::SafeU16) {
|
||||
unsafe {
|
||||
crate::bf_syscall_impl::bf_debug_op_dump_vmexit_log_impl(ppid);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_bf_debug_op_dump_vmexit_log {
|
||||
static mut ID: u64 = 0;
|
||||
|
||||
#[no_mangle]
|
||||
fn bf_debug_op_dump_vmexit_log_impl(ppid: u64) {
|
||||
unsafe {
|
||||
ID = ppid;
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_bf_debug_op_dump_vmexit_log() {
|
||||
super::bf_debug_op_dump_vmexit_log(42);
|
||||
unsafe {
|
||||
assert!(ID == 42);
|
||||
}
|
||||
crate::bf_debug_op_dump_vmexit_log_impl(ppid.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -205,29 +100,9 @@ mod test_bf_debug_op_dump_vmexit_log {
|
|||
/// <!-- inputs/outputs -->
|
||||
/// @param c The character to output
|
||||
///
|
||||
pub fn bf_debug_op_write_c(c: BfCharT) {
|
||||
pub fn bf_debug_op_write_c(c: bsl::CharT) {
|
||||
unsafe {
|
||||
crate::bf_syscall_impl::bf_debug_op_write_c_impl(c);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_bf_debug_op_write_c {
|
||||
static mut C: super::BfCharT = 0;
|
||||
|
||||
#[no_mangle]
|
||||
fn bf_debug_op_write_c_impl(c: super::BfCharT) {
|
||||
unsafe {
|
||||
C = c;
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_bf_debug_op_write_c() {
|
||||
super::bf_debug_op_write_c(42);
|
||||
unsafe {
|
||||
assert!(C == 42);
|
||||
}
|
||||
crate::bf_debug_op_write_c_impl(c);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -238,17 +113,12 @@ mod test_bf_debug_op_write_c {
|
|||
/// <!-- inputs/outputs -->
|
||||
/// @param str The virtual address of a null terminated string to output
|
||||
///
|
||||
pub fn bf_debug_op_write_str(str: BfCstrT) {
|
||||
pub fn bf_debug_op_write_str(str: bsl::CStrT, len: u64) {
|
||||
unsafe {
|
||||
crate::bf_syscall_impl::bf_debug_op_write_str_impl(str);
|
||||
crate::bf_debug_op_write_str_impl(str, len);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_bf_debug_op_write_str {
|
||||
// TODO
|
||||
}
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief This syscall tells the microkernel to output an extension's
|
||||
/// state to the console device the microkernel is currently using
|
||||
|
|
@ -257,29 +127,9 @@ mod test_bf_debug_op_write_str {
|
|||
/// <!-- inputs/outputs -->
|
||||
/// @param extid The EXTID of the extensions's state to output
|
||||
///
|
||||
pub fn bf_debug_op_dump_ext(extid: u16) {
|
||||
pub fn bf_debug_op_dump_ext(extid: bsl::SafeU16) {
|
||||
unsafe {
|
||||
crate::bf_syscall_impl::bf_debug_op_dump_ext_impl(extid);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_bf_debug_op_dump_ext {
|
||||
static mut ID: u64 = 0;
|
||||
|
||||
#[no_mangle]
|
||||
fn bf_debug_op_dump_ext_impl(extid: u64) {
|
||||
unsafe {
|
||||
ID = extid;
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_bf_debug_op_dump_ext() {
|
||||
super::bf_debug_op_dump_ext(42);
|
||||
unsafe {
|
||||
assert!(ID == 42);
|
||||
}
|
||||
crate::bf_debug_op_dump_ext_impl(extid.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -290,27 +140,7 @@ mod test_bf_debug_op_dump_ext {
|
|||
///
|
||||
pub fn bf_debug_op_dump_page_pool() {
|
||||
unsafe {
|
||||
crate::bf_syscall_impl::bf_debug_op_dump_page_pool_impl();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_bf_debug_op_dump_page_pool {
|
||||
static mut EXECUTED: bool = false;
|
||||
|
||||
#[no_mangle]
|
||||
fn bf_debug_op_dump_page_pool_impl() {
|
||||
unsafe {
|
||||
EXECUTED = true;
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_bf_debug_op_dump_page_pool() {
|
||||
super::bf_debug_op_dump_page_pool();
|
||||
unsafe {
|
||||
assert!(EXECUTED);
|
||||
}
|
||||
crate::bf_debug_op_dump_page_pool_impl();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -321,26 +151,6 @@ mod test_bf_debug_op_dump_page_pool {
|
|||
///
|
||||
pub fn bf_debug_op_dump_huge_pool() {
|
||||
unsafe {
|
||||
crate::bf_syscall_impl::bf_debug_op_dump_huge_pool_impl();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_bf_debug_op_dump_huge_pool {
|
||||
static mut EXECUTED: bool = false;
|
||||
|
||||
#[no_mangle]
|
||||
fn bf_debug_op_dump_huge_pool_impl() {
|
||||
unsafe {
|
||||
EXECUTED = true;
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_bf_debug_op_dump_huge_pool() {
|
||||
super::bf_debug_op_dump_huge_pool();
|
||||
unsafe {
|
||||
assert!(EXECUTED);
|
||||
}
|
||||
crate::bf_debug_op_dump_huge_pool_impl();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
use crate::types::BfCharT;
|
||||
/// @copyright
|
||||
/// Copyright (C) 2020 Assured Information Security, Inc.
|
||||
///
|
||||
|
|
@ -22,15 +21,13 @@ use crate::types::BfCharT;
|
|||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
/// SOFTWARE.
|
||||
use crate::types::BfCptrT;
|
||||
use crate::types::BfCstrT;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// TLS ops
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
extern "C" {
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// TLS ops
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_tls_rax.
|
||||
///
|
||||
|
|
@ -333,6 +330,11 @@ extern "C" {
|
|||
///
|
||||
pub fn bf_control_op_wait_impl();
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_control_op_again.
|
||||
///
|
||||
pub fn bf_control_op_again_impl();
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// bf_handle_ops
|
||||
// -------------------------------------------------------------------------
|
||||
|
|
@ -407,15 +409,20 @@ extern "C" {
|
|||
/// <!-- inputs/outputs -->
|
||||
/// @param reg0_in n/a
|
||||
///
|
||||
pub fn bf_debug_op_write_c_impl(reg0_in: BfCharT);
|
||||
pub fn bf_debug_op_write_c_impl(reg0_in: bsl::CharT); // NOLINT
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_debug_op_write_str.
|
||||
///
|
||||
/// <!-- inputs/outputs -->
|
||||
/// @param reg0_in n/a
|
||||
/// @param reg1_in n/a
|
||||
///
|
||||
pub fn bf_debug_op_write_str_impl(reg0_in: BfCstrT);
|
||||
pub fn bf_debug_op_write_str_impl(
|
||||
// NOLINT
|
||||
reg0_in: bsl::CStrT,
|
||||
reg1_in: u64,
|
||||
); // NOLINT
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_debug_op_dump_ext.
|
||||
|
|
@ -447,7 +454,7 @@ extern "C" {
|
|||
/// @param reg1_in n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_callback_op_register_bootstrap_impl(reg0_in: u64, reg1_in: BfCptrT) -> u64;
|
||||
pub fn bf_callback_op_register_bootstrap_impl(reg0_in: u64, reg1_in: bsl::CPtrT) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_callback_op_register_vmexit.
|
||||
|
|
@ -457,7 +464,7 @@ extern "C" {
|
|||
/// @param reg1_in n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_callback_op_register_vmexit_impl(reg0_in: u64, reg1_in: BfCptrT) -> u64;
|
||||
pub fn bf_callback_op_register_vmexit_impl(reg0_in: u64, reg1_in: bsl::CPtrT) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_callback_op_register_fail.
|
||||
|
|
@ -467,7 +474,7 @@ extern "C" {
|
|||
/// @param reg1_in n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_callback_op_register_fail_impl(reg0_in: u64, reg1_in: BfCptrT) -> u64;
|
||||
pub fn bf_callback_op_register_fail_impl(reg0_in: u64, reg1_in: bsl::CPtrT) -> u64;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// bf_vm_ops
|
||||
|
|
@ -507,7 +514,7 @@ extern "C" {
|
|||
reg0_in: u64,
|
||||
reg1_in: u16,
|
||||
reg2_in: u64,
|
||||
reg0_out: *mut BfCptrT,
|
||||
reg0_out: *mut bsl::CPtrT,
|
||||
) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
|
|
@ -519,7 +526,7 @@ extern "C" {
|
|||
/// @param reg2_in n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_vm_op_unmap_direct_impl(reg0_in: u64, reg1_in: u16, reg2_in: u64) -> u64;
|
||||
pub fn bf_vm_op_unmap_direct_impl(reg0_in: u64, reg1_in: u16, reg2_in: bsl::CPtrT) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_vm_op_unmap_direct_broadcast.
|
||||
|
|
@ -530,7 +537,21 @@ extern "C" {
|
|||
/// @param reg2_in n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_vm_op_unmap_direct_broadcast_impl(reg0_in: u64, reg1_in: u16, reg2_in: u64) -> u64;
|
||||
pub fn bf_vm_op_unmap_direct_broadcast_impl(
|
||||
reg0_in: u64,
|
||||
reg1_in: u16,
|
||||
reg2_in: bsl::CPtrT,
|
||||
) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_vm_op_tlb_flush.
|
||||
///
|
||||
/// <!-- inputs/outputs -->
|
||||
/// @param reg0_in n/a
|
||||
/// @param reg1_in n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_vm_op_tlb_flush_impl(reg0_in: u64, reg1_in: u16) -> u64;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// bf_vp_ops
|
||||
|
|
@ -542,16 +563,10 @@ extern "C" {
|
|||
/// <!-- inputs/outputs -->
|
||||
/// @param reg0_in n/a
|
||||
/// @param reg1_in n/a
|
||||
/// @param reg2_in n/a
|
||||
/// @param reg0_out n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_vp_op_create_vp_impl(
|
||||
reg0_in: u64,
|
||||
reg1_in: u16,
|
||||
reg2_in: u16,
|
||||
reg0_out: *mut u16,
|
||||
) -> u64;
|
||||
pub fn bf_vp_op_create_vp_impl(reg0_in: u64, reg1_in: u16, reg0_out: *mut u16) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_vp_op_destroy_vp.
|
||||
|
|
@ -614,12 +629,7 @@ extern "C" {
|
|||
/// @param reg0_out n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_vs_op_read_impl(
|
||||
reg0_in: u64,
|
||||
reg1_in: u16,
|
||||
reg2_in: u64,
|
||||
reg0_out: *const u64,
|
||||
) -> u64;
|
||||
pub fn bf_vs_op_read_impl(reg0_in: u64, reg1_in: u16, reg2_in: u64, reg0_out: *mut u64) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_vs_op_write.
|
||||
|
|
@ -655,14 +665,21 @@ extern "C" {
|
|||
pub fn bf_vs_op_run_current_impl(reg0_in: u64) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_vs_op_advance_ip.
|
||||
/// @brief Implements the ABI for bf_vs_op_advance_ip_and_run.
|
||||
///
|
||||
/// <!-- inputs/outputs -->
|
||||
/// @param reg0_in n/a
|
||||
/// @param reg1_in n/a
|
||||
/// @param reg2_in n/a
|
||||
/// @param reg3_in n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_vs_op_advance_ip_impl(reg0_in: u64, reg1_in: u16) -> u64;
|
||||
pub fn bf_vs_op_advance_ip_and_run_impl(
|
||||
reg0_in: u64,
|
||||
reg1_in: u16,
|
||||
reg2_in: u16,
|
||||
reg3_in: u16,
|
||||
) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_vs_op_advance_ip_and_run_current.
|
||||
|
|
@ -704,6 +721,46 @@ extern "C" {
|
|||
///
|
||||
pub fn bf_vs_op_migrate_impl(reg0_in: u64, reg1_in: u16, reg2_in: u16) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_vs_op_set_active.
|
||||
///
|
||||
/// <!-- inputs/outputs -->
|
||||
/// @param reg0_in n/a
|
||||
/// @param reg1_in n/a
|
||||
/// @param reg2_in n/a
|
||||
/// @param reg3_in n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_vs_op_set_active_impl(reg0_in: u64, reg1_in: u16, reg2_in: u16, reg3_in: u16) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_vs_op_advance_ip_and_set_active.
|
||||
///
|
||||
/// <!-- inputs/outputs -->
|
||||
/// @param reg0_in n/a
|
||||
/// @param reg1_in n/a
|
||||
/// @param reg2_in n/a
|
||||
/// @param reg3_in n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_vs_op_advance_ip_and_set_active_impl(
|
||||
reg0_in: u64,
|
||||
reg1_in: u16,
|
||||
reg2_in: u16,
|
||||
reg3_in: u16,
|
||||
) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_vs_op_tlb_flush.
|
||||
///
|
||||
/// <!-- inputs/outputs -->
|
||||
/// @param reg0_in n/a
|
||||
/// @param reg1_in n/a
|
||||
/// @param reg2_in n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_vs_op_tlb_flush_impl(reg0_in: u64, reg1_in: u16, reg2_in: u64) -> u64;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// bf_intrinsic_ops
|
||||
// -------------------------------------------------------------------------
|
||||
|
|
@ -717,7 +774,7 @@ extern "C" {
|
|||
/// @param reg0_out n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_intrinsic_op_rdmsr_impl(reg0_in: u64, reg1_in: u32, reg0_out: *const u64) -> u64;
|
||||
pub fn bf_intrinsic_op_rdmsr_impl(reg0_in: u64, reg1_in: u32, reg0_out: *mut u64) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_intrinsic_op_wrmsr.
|
||||
|
|
@ -730,45 +787,6 @@ extern "C" {
|
|||
///
|
||||
pub fn bf_intrinsic_op_wrmsr_impl(reg0_in: u64, reg1_in: u32, reg2_in: u64) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_intrinsic_op_invlpga.
|
||||
///
|
||||
/// <!-- inputs/outputs -->
|
||||
/// @param reg0_in n/a
|
||||
/// @param reg1_in n/a
|
||||
/// @param reg2_in n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_intrinsic_op_invlpga_impl(reg0_in: u64, reg1_in: u64, reg2_in: u64) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_intrinsic_op_invept.
|
||||
///
|
||||
/// <!-- inputs/outputs -->
|
||||
/// @param reg0_in n/a
|
||||
/// @param reg1_in n/a
|
||||
/// @param reg2_in n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_intrinsic_op_invept_impl(reg0_in: u64, reg1_in: u64, reg2_in: u64) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief Implements the ABI for bf_intrinsic_op_invvpid.
|
||||
///
|
||||
/// <!-- inputs/outputs -->
|
||||
/// @param reg0_in n/a
|
||||
/// @param reg1_in n/a
|
||||
/// @param reg2_in n/a
|
||||
/// @param reg3_in n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_intrinsic_op_invvpid_impl(
|
||||
reg0_in: u64,
|
||||
reg1_in: u64,
|
||||
reg2_in: u16,
|
||||
reg3_in: u64,
|
||||
) -> u64;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// bf_mem_ops
|
||||
// -------------------------------------------------------------------------
|
||||
|
|
@ -779,13 +797,13 @@ extern "C" {
|
|||
/// <!-- inputs/outputs -->
|
||||
/// @param reg0_in n/a
|
||||
/// @param reg0_out n/a
|
||||
/// @param reg1_out n/a
|
||||
/// @param pmut_reg1_out n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_mem_op_alloc_page_impl(
|
||||
reg0_in: u64,
|
||||
reg0_out: *mut BfCptrT,
|
||||
reg1_out: *const u64,
|
||||
reg0_out: *mut bsl::CPtrT,
|
||||
pmut_reg1_out: *mut u64,
|
||||
) -> u64;
|
||||
|
||||
/// <!-- description -->
|
||||
|
|
@ -795,13 +813,14 @@ extern "C" {
|
|||
/// @param reg0_in n/a
|
||||
/// @param reg1_in n/a
|
||||
/// @param reg0_out n/a
|
||||
/// @param reg1_out n/a
|
||||
/// @param pmut_reg1_out n/a
|
||||
/// @return n/a
|
||||
///
|
||||
pub fn bf_mem_op_alloc_huge_impl(
|
||||
reg0_in: u64,
|
||||
reg1_in: u64,
|
||||
reg0_out: *mut BfCptrT,
|
||||
reg1_out: *const u64,
|
||||
reg0_out: *mut bsl::CPtrT,
|
||||
pmut_reg1_out: *mut u64,
|
||||
) -> u64;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1225,7 +1225,12 @@ namespace syscall
|
|||
}
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief TODO
|
||||
/// @brief Executes a VS given the ID of the VM, VP and VS to
|
||||
/// execute. The VS must be assigned to the provided VP and the
|
||||
/// provided VP must be assigned to the provided VM. The VP and VS
|
||||
/// must not be executing on any other PP, and the VS must be
|
||||
/// assigned to the PP this syscall is executed on. Upon success,
|
||||
/// this syscall will not return.
|
||||
///
|
||||
/// <!-- inputs/outputs -->
|
||||
/// @param vmid The ID of the VM to run
|
||||
|
|
@ -1289,7 +1294,12 @@ namespace syscall
|
|||
}
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief TODO
|
||||
/// @brief Advances the IP and executes a VS given the ID of the VM,
|
||||
/// VP and VS to execute. The VS must be assigned to the provided
|
||||
/// VP and the provided VP must be assigned to the provided VM.
|
||||
/// The VP and VS must not be executing on any other PP, and the
|
||||
/// VS must be assigned to the PP this syscall is executed on.
|
||||
/// Upon success, this syscall will not return.
|
||||
///
|
||||
/// <!-- inputs/outputs -->
|
||||
/// @param vmid The ID of the VM to advance the IP for
|
||||
|
|
@ -1329,7 +1339,9 @@ namespace syscall
|
|||
}
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief TODO
|
||||
/// @brief bf_vs_op_advance_ip_and_run_current tells the microkernel
|
||||
/// to advance the IP of and execute the currently active VS, VP
|
||||
/// and VM.
|
||||
///
|
||||
/// <!-- inputs/outputs -->
|
||||
/// @return Returns bsl::errc_success on success, bsl::errc_failure
|
||||
|
|
@ -1418,7 +1430,8 @@ namespace syscall
|
|||
}
|
||||
|
||||
/// <!-- description -->
|
||||
/// @brief TODO
|
||||
/// @brief Migrates a VS to the provided PP. The VS must not be
|
||||
/// active.
|
||||
///
|
||||
/// <!-- inputs/outputs -->
|
||||
/// @param vsid The ID of the VS to migrate
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue