1 /* automatically generated by tools/bindgen-all-the-things */ 2 3 #![allow(clippy::missing_safety_doc)] 4 #![allow(clippy::undocumented_unsafe_blocks)] 5 #![allow(clippy::upper_case_acronyms)] 6 #![allow(non_upper_case_globals)] 7 #![allow(non_camel_case_types)] 8 #![allow(non_snake_case)] 9 #![allow(dead_code)] 10 11 pub const GH_IOCTL_TYPE: u8 = 71u8; 12 pub const GH_MEM_ALLOW_READ: u32 = 1; 13 pub const GH_MEM_ALLOW_WRITE: u32 = 2; 14 pub const GH_MEM_ALLOW_EXEC: u32 = 4; 15 pub const GH_FN_VCPU: u32 = 1; 16 pub const GH_FN_IRQFD: u32 = 2; 17 pub const GH_FN_IOEVENTFD: u32 = 3; 18 pub const GH_FN_MAX_ARG_SIZE: u32 = 256; 19 pub const GH_IRQFD_LEVEL: u32 = 1; 20 pub const GH_IOEVENTFD_DATAMATCH: u32 = 1; 21 pub const GH_VM_MAX_EXIT_REASON_SIZE: u32 = 8; 22 pub const GH_VCPU_EXIT_UNKNOWN: u32 = 0; 23 pub const GH_VCPU_EXIT_MMIO: u32 = 1; 24 pub const GH_VCPU_EXIT_STATUS: u32 = 2; 25 pub const GH_ANDROID_IOCTL_TYPE: u8 = 65u8; 26 pub type __le16 = u16; 27 pub type __be16 = u16; 28 pub type __le32 = u32; 29 pub type __be32 = u32; 30 pub type __le64 = u64; 31 pub type __be64 = u64; 32 pub type __sum16 = u16; 33 pub type __wsum = u32; 34 pub type __poll_t = ::std::os::raw::c_uint; 35 #[repr(C)] 36 #[derive(Debug, Default, Copy, Clone)] 37 pub struct gh_userspace_memory_region { 38 pub label: u32, 39 pub flags: u32, 40 pub guest_phys_addr: u64, 41 pub memory_size: u64, 42 pub userspace_addr: u64, 43 } 44 #[repr(C)] 45 #[derive(Debug, Default, Copy, Clone)] 46 pub struct gh_vm_dtb_config { 47 pub guest_phys_addr: u64, 48 pub size: u64, 49 } 50 #[repr(C)] 51 #[derive(Debug, Default, Copy, Clone)] 52 pub struct gh_fn_vcpu_arg { 53 pub id: u32, 54 } 55 #[repr(C)] 56 #[derive(Debug, Default, Copy, Clone)] 57 pub struct gh_fn_irqfd_arg { 58 pub fd: u32, 59 pub label: u32, 60 pub flags: u32, 61 pub padding: u32, 62 } 63 #[repr(C)] 64 #[derive(Debug, Default, Copy, Clone)] 65 pub struct gh_fn_ioeventfd_arg { 66 pub datamatch: u64, 67 pub addr: u64, 68 pub len: u32, 69 pub fd: i32, 70 pub flags: u32, 71 pub padding: u32, 72 } 73 #[repr(C)] 74 #[derive(Debug, Default, Copy, Clone)] 75 pub struct gh_fn_desc { 76 pub type_: u32, 77 pub arg_size: u32, 78 pub arg: u64, 79 } 80 pub const GH_VM_STATUS_GH_VM_STATUS_LOAD_FAILED: gh_vm_status = 1; 81 pub const GH_VM_STATUS_GH_VM_STATUS_EXITED: gh_vm_status = 2; 82 pub const GH_VM_STATUS_GH_VM_STATUS_CRASHED: gh_vm_status = 3; 83 pub type gh_vm_status = ::std::os::raw::c_uint; 84 #[repr(C)] 85 #[derive(Debug, Default, Copy, Clone)] 86 pub struct gh_vm_exit_info { 87 pub type_: u16, 88 pub padding: u16, 89 pub reason_size: u32, 90 pub reason: [u8; 8usize], 91 } 92 #[repr(C)] 93 #[derive(Copy, Clone)] 94 pub struct gh_vcpu_run { 95 pub immediate_exit: u8, 96 pub padding: [u8; 7usize], 97 pub exit_reason: u32, 98 pub __bindgen_anon_1: gh_vcpu_run__bindgen_ty_1, 99 } 100 #[repr(C)] 101 #[derive(Copy, Clone)] 102 pub union gh_vcpu_run__bindgen_ty_1 { 103 pub mmio: gh_vcpu_run__bindgen_ty_1__bindgen_ty_1, 104 pub status: gh_vcpu_run__bindgen_ty_1__bindgen_ty_2, 105 } 106 #[repr(C)] 107 #[derive(Debug, Default, Copy, Clone)] 108 pub struct gh_vcpu_run__bindgen_ty_1__bindgen_ty_1 { 109 pub phys_addr: u64, 110 pub data: [u8; 8usize], 111 pub len: u32, 112 pub is_write: u8, 113 } 114 #[repr(C)] 115 #[derive(Debug, Copy, Clone)] 116 pub struct gh_vcpu_run__bindgen_ty_1__bindgen_ty_2 { 117 pub status: gh_vm_status, 118 pub exit_info: gh_vm_exit_info, 119 } 120 impl Default for gh_vcpu_run__bindgen_ty_1__bindgen_ty_2 { default() -> Self121 fn default() -> Self { 122 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 123 unsafe { 124 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 125 s.assume_init() 126 } 127 } 128 } 129 impl Default for gh_vcpu_run__bindgen_ty_1 { default() -> Self130 fn default() -> Self { 131 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 132 unsafe { 133 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 134 s.assume_init() 135 } 136 } 137 } 138 impl Default for gh_vcpu_run { default() -> Self139 fn default() -> Self { 140 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 141 unsafe { 142 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 143 s.assume_init() 144 } 145 } 146 } 147 #[repr(C)] 148 #[derive(Debug, Default, Copy, Clone)] 149 pub struct gh_vm_firmware_config { 150 pub guest_phys_addr: u64, 151 pub size: u64, 152 } 153