| // Copyright 2025 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // Generated by sdk/lib/driver/runtime/rust/libasync/sys/bindgen.sh using bindgen 0.72.0 |
| |
| #![allow(dead_code)] |
| #![allow(non_camel_case_types)] |
| #![allow(non_snake_case)] |
| |
| use zx_types::*; |
| |
| pub type async_dispatcher_t = async_dispatcher; |
| pub type async_guest_bell_trap_t = async_guest_bell_trap; |
| pub type async_wait_t = async_wait; |
| pub type async_task_t = async_task; |
| pub type async_receiver_t = async_receiver; |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone)] |
| pub struct async_irq { |
| _unused: [u8; 0], |
| } |
| pub type async_irq_t = async_irq; |
| pub type async_paged_vmo_t = async_paged_vmo; |
| pub type async_sequence_id_t = async_sequence_id; |
| #[repr(C)] |
| #[derive(Debug, Default, Copy, Clone)] |
| pub struct async_state_t { |
| pub reserved: [usize; 2usize], |
| } |
| #[allow(clippy::unnecessary_operation, clippy::identity_op)] |
| const _: () = { |
| ["Size of async_state_t"][::core::mem::size_of::<async_state_t>() - 16usize]; |
| ["Alignment of async_state_t"][::core::mem::align_of::<async_state_t>() - 8usize]; |
| ["Offset of field: async_state_t::reserved"] |
| [::core::mem::offset_of!(async_state_t, reserved) - 0usize]; |
| }; |
| pub type async_ops_version_t = u32; |
| #[repr(C)] |
| #[derive(Debug, Default, Copy, Clone)] |
| pub struct async_ops { |
| pub version: async_ops_version_t, |
| pub reserved: u32, |
| pub v1: async_ops_v1, |
| pub v2: async_ops_v2, |
| pub v3: async_ops_v3, |
| } |
| #[repr(C)] |
| #[derive(Debug, Default, Copy, Clone)] |
| pub struct async_ops_v1 { |
| pub now: ::core::option::Option< |
| unsafe extern "C" fn(dispatcher: *mut async_dispatcher_t) -> zx_time_t, |
| >, |
| pub begin_wait: ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| wait: *mut async_wait_t, |
| ) -> zx_status_t, |
| >, |
| pub cancel_wait: ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| wait: *mut async_wait_t, |
| ) -> zx_status_t, |
| >, |
| pub post_task: ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| task: *mut async_task_t, |
| ) -> zx_status_t, |
| >, |
| pub cancel_task: ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| task: *mut async_task_t, |
| ) -> zx_status_t, |
| >, |
| pub queue_packet: ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| receiver: *mut async_receiver_t, |
| data: *const zx_packet_user_t, |
| ) -> zx_status_t, |
| >, |
| pub set_guest_bell_trap: ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| trap: *mut async_guest_bell_trap_t, |
| guest: zx_handle_t, |
| addr: zx_vaddr_t, |
| length: usize, |
| ) -> zx_status_t, |
| >, |
| } |
| #[allow(clippy::unnecessary_operation, clippy::identity_op)] |
| const _: () = { |
| ["Size of async_ops_v1"][::core::mem::size_of::<async_ops_v1>() - 56usize]; |
| ["Alignment of async_ops_v1"][::core::mem::align_of::<async_ops_v1>() - 8usize]; |
| ["Offset of field: async_ops_v1::now"][::core::mem::offset_of!(async_ops_v1, now) - 0usize]; |
| ["Offset of field: async_ops_v1::begin_wait"] |
| [::core::mem::offset_of!(async_ops_v1, begin_wait) - 8usize]; |
| ["Offset of field: async_ops_v1::cancel_wait"] |
| [::core::mem::offset_of!(async_ops_v1, cancel_wait) - 16usize]; |
| ["Offset of field: async_ops_v1::post_task"] |
| [::core::mem::offset_of!(async_ops_v1, post_task) - 24usize]; |
| ["Offset of field: async_ops_v1::cancel_task"] |
| [::core::mem::offset_of!(async_ops_v1, cancel_task) - 32usize]; |
| ["Offset of field: async_ops_v1::queue_packet"] |
| [::core::mem::offset_of!(async_ops_v1, queue_packet) - 40usize]; |
| ["Offset of field: async_ops_v1::set_guest_bell_trap"] |
| [::core::mem::offset_of!(async_ops_v1, set_guest_bell_trap) - 48usize]; |
| }; |
| #[repr(C)] |
| #[derive(Debug, Default, Copy, Clone)] |
| pub struct async_ops_v2 { |
| pub bind_irq: ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| irq: *mut async_irq_t, |
| ) -> zx_status_t, |
| >, |
| pub unbind_irq: ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| irq: *mut async_irq_t, |
| ) -> zx_status_t, |
| >, |
| pub create_paged_vmo: ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| paged_vmo: *mut async_paged_vmo_t, |
| options: u32, |
| pager: zx_handle_t, |
| vmo_size: u64, |
| vmo_out: *mut zx_handle_t, |
| ) -> zx_status_t, |
| >, |
| pub detach_paged_vmo: ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| paged_vmo: *mut async_paged_vmo_t, |
| ) -> zx_status_t, |
| >, |
| } |
| #[allow(clippy::unnecessary_operation, clippy::identity_op)] |
| const _: () = { |
| ["Size of async_ops_v2"][::core::mem::size_of::<async_ops_v2>() - 32usize]; |
| ["Alignment of async_ops_v2"][::core::mem::align_of::<async_ops_v2>() - 8usize]; |
| ["Offset of field: async_ops_v2::bind_irq"] |
| [::core::mem::offset_of!(async_ops_v2, bind_irq) - 0usize]; |
| ["Offset of field: async_ops_v2::unbind_irq"] |
| [::core::mem::offset_of!(async_ops_v2, unbind_irq) - 8usize]; |
| ["Offset of field: async_ops_v2::create_paged_vmo"] |
| [::core::mem::offset_of!(async_ops_v2, create_paged_vmo) - 16usize]; |
| ["Offset of field: async_ops_v2::detach_paged_vmo"] |
| [::core::mem::offset_of!(async_ops_v2, detach_paged_vmo) - 24usize]; |
| }; |
| #[repr(C)] |
| #[derive(Debug, Default, Copy, Clone)] |
| pub struct async_ops_v3 { |
| pub get_sequence_id: ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| out_sequence_id: *mut async_sequence_id_t, |
| out_error: *mut *const ::core::ffi::c_char, |
| ) -> zx_status_t, |
| >, |
| pub check_sequence_id: ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| sequence_id: async_sequence_id_t, |
| out_error: *mut *const ::core::ffi::c_char, |
| ) -> zx_status_t, |
| >, |
| } |
| #[allow(clippy::unnecessary_operation, clippy::identity_op)] |
| const _: () = { |
| ["Size of async_ops_v3"][::core::mem::size_of::<async_ops_v3>() - 16usize]; |
| ["Alignment of async_ops_v3"][::core::mem::align_of::<async_ops_v3>() - 8usize]; |
| ["Offset of field: async_ops_v3::get_sequence_id"] |
| [::core::mem::offset_of!(async_ops_v3, get_sequence_id) - 0usize]; |
| ["Offset of field: async_ops_v3::check_sequence_id"] |
| [::core::mem::offset_of!(async_ops_v3, check_sequence_id) - 8usize]; |
| }; |
| #[allow(clippy::unnecessary_operation, clippy::identity_op)] |
| const _: () = { |
| ["Size of async_ops"][::core::mem::size_of::<async_ops>() - 112usize]; |
| ["Alignment of async_ops"][::core::mem::align_of::<async_ops>() - 8usize]; |
| ["Offset of field: async_ops::version"][::core::mem::offset_of!(async_ops, version) - 0usize]; |
| ["Offset of field: async_ops::reserved"][::core::mem::offset_of!(async_ops, reserved) - 4usize]; |
| ["Offset of field: async_ops::v1"][::core::mem::offset_of!(async_ops, v1) - 8usize]; |
| ["Offset of field: async_ops::v2"][::core::mem::offset_of!(async_ops, v2) - 64usize]; |
| ["Offset of field: async_ops::v3"][::core::mem::offset_of!(async_ops, v3) - 96usize]; |
| }; |
| pub type async_ops_t = async_ops; |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone)] |
| pub struct async_dispatcher { |
| pub ops: *const async_ops_t, |
| } |
| #[allow(clippy::unnecessary_operation, clippy::identity_op)] |
| const _: () = { |
| ["Size of async_dispatcher"][::core::mem::size_of::<async_dispatcher>() - 8usize]; |
| ["Alignment of async_dispatcher"][::core::mem::align_of::<async_dispatcher>() - 8usize]; |
| ["Offset of field: async_dispatcher::ops"] |
| [::core::mem::offset_of!(async_dispatcher, ops) - 0usize]; |
| }; |
| impl Default for async_dispatcher { |
| fn default() -> Self { |
| let mut s = ::core::mem::MaybeUninit::<Self>::uninit(); |
| unsafe { |
| ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); |
| s.assume_init() |
| } |
| } |
| } |
| pub type async_paged_vmo_handler_t = ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| paged_vmo: *mut async_paged_vmo_t, |
| status: zx_status_t, |
| request: *const zx_packet_page_request_t, |
| ), |
| >; |
| #[repr(C)] |
| pub struct async_paged_vmo { |
| pub state: async_state_t, |
| pub handler: async_paged_vmo_handler_t, |
| pub pager: zx_handle_t, |
| pub vmo: zx_handle_t, |
| } |
| #[allow(clippy::unnecessary_operation, clippy::identity_op)] |
| const _: () = { |
| ["Size of async_paged_vmo"][::core::mem::size_of::<async_paged_vmo>() - 32usize]; |
| ["Alignment of async_paged_vmo"][::core::mem::align_of::<async_paged_vmo>() - 8usize]; |
| ["Offset of field: async_paged_vmo::state"] |
| [::core::mem::offset_of!(async_paged_vmo, state) - 0usize]; |
| ["Offset of field: async_paged_vmo::handler"] |
| [::core::mem::offset_of!(async_paged_vmo, handler) - 16usize]; |
| ["Offset of field: async_paged_vmo::pager"] |
| [::core::mem::offset_of!(async_paged_vmo, pager) - 24usize]; |
| ["Offset of field: async_paged_vmo::vmo"] |
| [::core::mem::offset_of!(async_paged_vmo, vmo) - 28usize]; |
| }; |
| impl Default for async_paged_vmo { |
| fn default() -> Self { |
| let mut s = ::core::mem::MaybeUninit::<Self>::uninit(); |
| unsafe { |
| ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); |
| s.assume_init() |
| } |
| } |
| } |
| impl ::core::fmt::Debug for async_paged_vmo { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| write!(f, "async_paged_vmo {{ state: {:?}, handler: {:?} }}", self.state, self.handler) |
| } |
| } |
| unsafe extern "C" { |
| pub fn async_create_paged_vmo( |
| dispatcher: *mut async_dispatcher_t, |
| paged_vmo: *mut async_paged_vmo_t, |
| options: u32, |
| pager: zx_handle_t, |
| vmo_size: u64, |
| vmo_out: *mut zx_handle_t, |
| ) -> zx_status_t; |
| } |
| unsafe extern "C" { |
| pub fn async_detach_paged_vmo( |
| dispatcher: *mut async_dispatcher_t, |
| paged_vmo: *mut async_paged_vmo_t, |
| ) -> zx_status_t; |
| } |
| pub type async_receiver_handler_t = ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| receiver: *mut async_receiver_t, |
| status: zx_status_t, |
| data: *const zx_packet_user_t, |
| ), |
| >; |
| #[repr(C)] |
| #[derive(Debug, Default, Copy, Clone)] |
| pub struct async_receiver { |
| pub state: async_state_t, |
| pub handler: async_receiver_handler_t, |
| } |
| #[allow(clippy::unnecessary_operation, clippy::identity_op)] |
| const _: () = { |
| ["Size of async_receiver"][::core::mem::size_of::<async_receiver>() - 24usize]; |
| ["Alignment of async_receiver"][::core::mem::align_of::<async_receiver>() - 8usize]; |
| ["Offset of field: async_receiver::state"] |
| [::core::mem::offset_of!(async_receiver, state) - 0usize]; |
| ["Offset of field: async_receiver::handler"] |
| [::core::mem::offset_of!(async_receiver, handler) - 16usize]; |
| }; |
| unsafe extern "C" { |
| pub fn async_queue_packet( |
| dispatcher: *mut async_dispatcher_t, |
| receiver: *mut async_receiver_t, |
| data: *const zx_packet_user_t, |
| ) -> zx_status_t; |
| } |
| #[repr(C)] |
| #[derive(Debug, Default, Copy, Clone)] |
| pub struct async_sequence_id { |
| pub value: u64, |
| } |
| #[allow(clippy::unnecessary_operation, clippy::identity_op)] |
| const _: () = { |
| ["Size of async_sequence_id"][::core::mem::size_of::<async_sequence_id>() - 8usize]; |
| ["Alignment of async_sequence_id"][::core::mem::align_of::<async_sequence_id>() - 8usize]; |
| ["Offset of field: async_sequence_id::value"] |
| [::core::mem::offset_of!(async_sequence_id, value) - 0usize]; |
| }; |
| unsafe extern "C" { |
| pub fn async_get_sequence_id( |
| dispatcher: *mut async_dispatcher_t, |
| out_sequence_id: *mut async_sequence_id_t, |
| out_error: *mut *const ::core::ffi::c_char, |
| ) -> zx_status_t; |
| } |
| unsafe extern "C" { |
| pub fn async_check_sequence_id( |
| dispatcher: *mut async_dispatcher_t, |
| sequence_id: async_sequence_id_t, |
| out_error: *mut *const ::core::ffi::c_char, |
| ) -> zx_status_t; |
| } |
| pub type async_task_handler_t = ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| task: *mut async_task_t, |
| status: zx_status_t, |
| ), |
| >; |
| #[repr(C)] |
| pub struct async_task { |
| pub state: async_state_t, |
| pub handler: async_task_handler_t, |
| pub deadline: zx_time_t, |
| } |
| #[allow(clippy::unnecessary_operation, clippy::identity_op)] |
| const _: () = { |
| ["Size of async_task"][::core::mem::size_of::<async_task>() - 32usize]; |
| ["Alignment of async_task"][::core::mem::align_of::<async_task>() - 8usize]; |
| ["Offset of field: async_task::state"][::core::mem::offset_of!(async_task, state) - 0usize]; |
| ["Offset of field: async_task::handler"] |
| [::core::mem::offset_of!(async_task, handler) - 16usize]; |
| ["Offset of field: async_task::deadline"] |
| [::core::mem::offset_of!(async_task, deadline) - 24usize]; |
| }; |
| impl Default for async_task { |
| fn default() -> Self { |
| let mut s = ::core::mem::MaybeUninit::<Self>::uninit(); |
| unsafe { |
| ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); |
| s.assume_init() |
| } |
| } |
| } |
| impl ::core::fmt::Debug for async_task { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| write!(f, "async_task {{ state: {:?}, handler: {:?} }}", self.state, self.handler) |
| } |
| } |
| unsafe extern "C" { |
| pub fn async_post_task( |
| dispatcher: *mut async_dispatcher_t, |
| task: *mut async_task_t, |
| ) -> zx_status_t; |
| } |
| unsafe extern "C" { |
| pub fn async_cancel_task( |
| dispatcher: *mut async_dispatcher_t, |
| task: *mut async_task_t, |
| ) -> zx_status_t; |
| } |
| unsafe extern "C" { |
| pub fn async_now(dispatcher: *mut async_dispatcher_t) -> zx_time_t; |
| } |
| pub type async_guest_bell_trap_handler_t = ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| trap: *mut async_guest_bell_trap_t, |
| status: zx_status_t, |
| bell: *const zx_packet_guest_bell_t, |
| ), |
| >; |
| #[repr(C)] |
| #[derive(Debug, Default, Copy, Clone)] |
| pub struct async_guest_bell_trap { |
| pub state: async_state_t, |
| pub handler: async_guest_bell_trap_handler_t, |
| } |
| #[allow(clippy::unnecessary_operation, clippy::identity_op)] |
| const _: () = { |
| ["Size of async_guest_bell_trap"][::core::mem::size_of::<async_guest_bell_trap>() - 24usize]; |
| ["Alignment of async_guest_bell_trap"] |
| [::core::mem::align_of::<async_guest_bell_trap>() - 8usize]; |
| ["Offset of field: async_guest_bell_trap::state"] |
| [::core::mem::offset_of!(async_guest_bell_trap, state) - 0usize]; |
| ["Offset of field: async_guest_bell_trap::handler"] |
| [::core::mem::offset_of!(async_guest_bell_trap, handler) - 16usize]; |
| }; |
| unsafe extern "C" { |
| pub fn async_set_guest_bell_trap( |
| dispatcher: *mut async_dispatcher_t, |
| trap: *mut async_guest_bell_trap_t, |
| guest: zx_handle_t, |
| addr: zx_vaddr_t, |
| length: usize, |
| ) -> zx_status_t; |
| } |
| pub type async_wait_handler_t = ::core::option::Option< |
| unsafe extern "C" fn( |
| dispatcher: *mut async_dispatcher_t, |
| wait: *mut async_wait_t, |
| status: zx_status_t, |
| signal: *const zx_packet_signal_t, |
| ), |
| >; |
| #[repr(C)] |
| pub struct async_wait { |
| pub state: async_state_t, |
| pub handler: async_wait_handler_t, |
| pub object: zx_handle_t, |
| pub trigger: zx_signals_t, |
| pub options: u32, |
| } |
| #[allow(clippy::unnecessary_operation, clippy::identity_op)] |
| const _: () = { |
| ["Size of async_wait"][::core::mem::size_of::<async_wait>() - 40usize]; |
| ["Alignment of async_wait"][::core::mem::align_of::<async_wait>() - 8usize]; |
| ["Offset of field: async_wait::state"][::core::mem::offset_of!(async_wait, state) - 0usize]; |
| ["Offset of field: async_wait::handler"] |
| [::core::mem::offset_of!(async_wait, handler) - 16usize]; |
| ["Offset of field: async_wait::object"][::core::mem::offset_of!(async_wait, object) - 24usize]; |
| ["Offset of field: async_wait::trigger"] |
| [::core::mem::offset_of!(async_wait, trigger) - 28usize]; |
| ["Offset of field: async_wait::options"] |
| [::core::mem::offset_of!(async_wait, options) - 32usize]; |
| }; |
| impl Default for async_wait { |
| fn default() -> Self { |
| let mut s = ::core::mem::MaybeUninit::<Self>::uninit(); |
| unsafe { |
| ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); |
| s.assume_init() |
| } |
| } |
| } |
| impl ::core::fmt::Debug for async_wait { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| write!(f, "async_wait {{ state: {:?}, handler: {:?} }}", self.state, self.handler) |
| } |
| } |
| unsafe extern "C" { |
| pub fn async_begin_wait( |
| dispatcher: *mut async_dispatcher_t, |
| wait: *mut async_wait_t, |
| ) -> zx_status_t; |
| } |
| unsafe extern "C" { |
| pub fn async_cancel_wait( |
| dispatcher: *mut async_dispatcher_t, |
| wait: *mut async_wait_t, |
| ) -> zx_status_t; |
| } |