Path: blob/main/hypervisor/src/gunyah/gunyah_sys/bindings.rs
5394 views
/* automatically generated by tools/bindgen-all-the-things */12#![allow(clippy::missing_safety_doc)]3#![allow(clippy::undocumented_unsafe_blocks)]4#![allow(clippy::upper_case_acronyms)]5#![allow(non_upper_case_globals)]6#![allow(non_camel_case_types)]7#![allow(non_snake_case)]8#![allow(dead_code)]910pub const GH_IOCTL_TYPE: u8 = 71u8;11pub const GH_MEM_ALLOW_READ: u32 = 1;12pub const GH_MEM_ALLOW_WRITE: u32 = 2;13pub const GH_MEM_ALLOW_EXEC: u32 = 4;14pub const GH_FN_VCPU: u32 = 1;15pub const GH_FN_IRQFD: u32 = 2;16pub const GH_FN_IOEVENTFD: u32 = 3;17pub const GH_FN_MAX_ARG_SIZE: u32 = 256;18pub const GH_IRQFD_LEVEL: u32 = 1;19pub const GH_IOEVENTFD_DATAMATCH: u32 = 1;20pub const GH_VM_MAX_EXIT_REASON_SIZE: u32 = 8;21pub const GH_VCPU_EXIT_UNKNOWN: u32 = 0;22pub const GH_VCPU_EXIT_MMIO: u32 = 1;23pub const GH_VCPU_EXIT_STATUS: u32 = 2;24pub const GH_ANDROID_IOCTL_TYPE: u8 = 65u8;25pub const GH_VM_BOOT_CONTEXT_REG_SHIFT: u32 = 8;26pub type i8 = ::std::os::raw::c_schar;27pub type u8 = ::std::os::raw::c_uchar;28pub type i16 = ::std::os::raw::c_short;29pub type u16 = ::std::os::raw::c_ushort;30pub type i32 = ::std::os::raw::c_int;31pub type u32 = ::std::os::raw::c_uint;32pub type i64 = ::std::os::raw::c_longlong;33pub type u64 = ::std::os::raw::c_ulonglong;34pub type __s128 = i128;35pub type __u128 = u128;36pub type __le16 = u16;37pub type __be16 = u16;38pub type __le32 = u32;39pub type __be32 = u32;40pub type __le64 = u64;41pub type __be64 = u64;42pub type __sum16 = u16;43pub type __wsum = u32;44pub type __poll_t = ::std::os::raw::c_uint;45pub const gunyah_auth_type_GUNYAH_ANDROID_PVM_TYPE: gunyah_auth_type = 0;46pub const gunyah_auth_type_GUNYAH_QCOM_TRUSTED_VM_TYPE: gunyah_auth_type = 1;47pub type gunyah_auth_type = ::std::os::raw::c_uint;48#[repr(C)]49#[derive(Debug, Default, Copy, Clone)]50pub struct gunyah_qtvm_auth_arg {51pub vm_id: u16,52pub pas_id: u32,53pub guest_phys_addr: u64,54pub size: u64,55}56#[repr(C)]57#[derive(Debug, Default, Copy, Clone)]58pub struct gunyah_auth_desc {59pub type_: u32,60pub arg_size: u32,61pub arg: u64,62}63#[repr(C)]64#[derive(Debug, Default, Copy, Clone)]65pub struct gh_userspace_memory_region {66pub label: u32,67pub flags: u32,68pub guest_phys_addr: u64,69pub memory_size: u64,70pub userspace_addr: u64,71}72#[repr(C)]73#[derive(Debug, Default, Copy, Clone)]74pub struct gh_vm_dtb_config {75pub guest_phys_addr: u64,76pub size: u64,77}78pub mod gh_vm_boot_context_reg {79pub type Type = ::std::os::raw::c_uint;80pub const REG_SET_X: Type = 0;81pub const REG_SET_PC: Type = 1;82pub const REG_SET_SP: Type = 2;83}84#[repr(C)]85#[derive(Debug, Default, Copy, Clone)]86pub struct gh_vm_boot_context {87pub reg: u32,88pub reserved: u32,89pub value: u64,90}91#[repr(C)]92#[derive(Debug, Default, Copy, Clone)]93pub struct gh_fn_vcpu_arg {94pub id: u32,95}96#[repr(C)]97#[derive(Debug, Default, Copy, Clone)]98pub struct gh_fn_irqfd_arg {99pub fd: u32,100pub label: u32,101pub flags: u32,102pub padding: u32,103}104#[repr(C)]105#[derive(Debug, Default, Copy, Clone)]106pub struct gh_fn_ioeventfd_arg {107pub datamatch: u64,108pub addr: u64,109pub len: u32,110pub fd: i32,111pub flags: u32,112pub padding: u32,113}114#[repr(C)]115#[derive(Debug, Default, Copy, Clone)]116pub struct gh_fn_desc {117pub type_: u32,118pub arg_size: u32,119pub arg: u64,120}121pub const GH_VM_STATUS_GH_VM_STATUS_LOAD_FAILED: gh_vm_status = 1;122pub const GH_VM_STATUS_GH_VM_STATUS_EXITED: gh_vm_status = 2;123pub const GH_VM_STATUS_GH_VM_STATUS_CRASHED: gh_vm_status = 3;124pub type gh_vm_status = ::std::os::raw::c_uint;125#[repr(C)]126#[derive(Debug, Default, Copy, Clone)]127pub struct gh_vm_exit_info {128pub type_: u16,129pub padding: u16,130pub reason_size: u32,131pub reason: [u8; 8usize],132}133#[repr(C)]134#[derive(Copy, Clone)]135pub struct gh_vcpu_run {136pub immediate_exit: u8,137pub padding: [u8; 7usize],138pub exit_reason: u32,139pub __bindgen_anon_1: gh_vcpu_run__bindgen_ty_1,140}141#[repr(C)]142#[derive(Copy, Clone)]143pub union gh_vcpu_run__bindgen_ty_1 {144pub mmio: gh_vcpu_run__bindgen_ty_1__bindgen_ty_1,145pub status: gh_vcpu_run__bindgen_ty_1__bindgen_ty_2,146}147#[repr(C)]148#[derive(Debug, Default, Copy, Clone)]149pub struct gh_vcpu_run__bindgen_ty_1__bindgen_ty_1 {150pub phys_addr: u64,151pub data: [u8; 8usize],152pub len: u32,153pub is_write: u8,154}155#[repr(C)]156#[derive(Debug, Copy, Clone)]157pub struct gh_vcpu_run__bindgen_ty_1__bindgen_ty_2 {158pub status: gh_vm_status,159pub exit_info: gh_vm_exit_info,160}161impl Default for gh_vcpu_run__bindgen_ty_1__bindgen_ty_2 {162fn default() -> Self {163let mut s = ::std::mem::MaybeUninit::<Self>::uninit();164unsafe {165::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);166s.assume_init()167}168}169}170impl Default for gh_vcpu_run__bindgen_ty_1 {171fn default() -> Self {172let mut s = ::std::mem::MaybeUninit::<Self>::uninit();173unsafe {174::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);175s.assume_init()176}177}178}179impl Default for gh_vcpu_run {180fn default() -> Self {181let mut s = ::std::mem::MaybeUninit::<Self>::uninit();182unsafe {183::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);184s.assume_init()185}186}187}188#[repr(C)]189#[derive(Debug, Default, Copy, Clone)]190pub struct gh_vm_firmware_config {191pub guest_phys_addr: u64,192pub size: u64,193}194#[repr(C)]195#[derive(Debug, Default, Copy, Clone)]196pub struct gunyah_address_range {197pub guest_phys_addr: u64,198pub size: u64,199}200pub const GUNYAH_MEM_ALLOW_READ: gunyah_map_flags = 1;201pub const GUNYAH_MEM_ALLOW_WRITE: gunyah_map_flags = 2;202pub const GUNYAH_MEM_ALLOW_EXEC: gunyah_map_flags = 4;203pub const GUNYAH_MEM_ALLOW_RWX: gunyah_map_flags = 7;204pub const GUNYAH_MEM_DEFAULT_ACCESS: gunyah_map_flags = 0;205pub const GUNYAH_MEM_FORCE_LEND: gunyah_map_flags = 16;206pub const GUNYAH_MEM_FORCE_SHARE: gunyah_map_flags = 32;207pub const GUNYAH_MEM_UNMAP: gunyah_map_flags = 256;208pub type gunyah_map_flags = ::std::os::raw::c_uint;209#[repr(C)]210#[derive(Debug, Default, Copy, Clone)]211pub struct gunyah_map_cma_mem_args {212pub label: u32,213pub guest_addr: u64,214pub flags: u32,215pub guest_mem_fd: u32,216pub offset: u64,217pub size: u64,218}219220221