add cpu model to architectures for rust bindings

This commit is contained in:
lockbox
2023-07-13 13:58:14 -04:00
parent 84fe5d1756
commit 2f2bf8d96f
10 changed files with 720 additions and 5 deletions

View File

@@ -1,3 +1,5 @@
#![allow(non_camel_case_types)]
// M68K registers
#[repr(C)]
#[derive(PartialEq, Debug, Clone, Copy)]
@@ -29,3 +31,29 @@ impl From<RegisterM68K> for i32 {
r as i32
}
}
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum M68kCpuModel {
UC_CPU_M68K_M5206 = 0,
UC_CPU_M68K_M68000 = 1,
UC_CPU_M68K_M68020 = 2,
UC_CPU_M68K_M68030 = 3,
UC_CPU_M68K_M68040 = 4,
UC_CPU_M68K_M68060 = 5,
UC_CPU_M68K_M5208 = 6,
UC_CPU_M68K_CFV4E = 7,
UC_CPU_M68K_ANY = 8,
}
impl From<M68kCpuModel> for i32 {
fn from(value: M68kCpuModel) -> Self {
value as i32
}
}
impl From<&M68kCpuModel> for i32 {
fn from(value: &M68kCpuModel) -> Self {
(*value) as i32
}
}