fdf_sys/
bindings.rs

1// Copyright 2024 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Generated by sdk/lib/driver/runtime/rust/bindgen.sh using bindgen 0.71.1
6
7#![allow(dead_code)]
8#![allow(non_camel_case_types)]
9#![allow(non_snake_case)]
10
11pub use zx_types::*;
12
13pub const DRIVER_REGISTRATION_VERSION_1: u32 = 1;
14pub const DRIVER_REGISTRATION_VERSION_MAX: u32 = 1;
15pub type async_dispatcher_t = async_dispatcher;
16pub type async_guest_bell_trap_t = async_guest_bell_trap;
17pub type async_wait_t = async_wait;
18pub type async_task_t = async_task;
19pub type async_receiver_t = async_receiver;
20#[repr(C)]
21#[derive(Debug, Copy, Clone)]
22pub struct async_irq {
23    _unused: [u8; 0],
24}
25pub type async_irq_t = async_irq;
26pub type async_paged_vmo_t = async_paged_vmo;
27pub type async_sequence_id_t = async_sequence_id;
28#[repr(C)]
29#[derive(Debug, Default, Copy, Clone)]
30pub struct async_state_t {
31    pub reserved: [usize; 2usize],
32}
33#[allow(clippy::unnecessary_operation, clippy::identity_op)]
34const _: () = {
35    ["Size of async_state_t"][::core::mem::size_of::<async_state_t>() - 16usize];
36    ["Alignment of async_state_t"][::core::mem::align_of::<async_state_t>() - 8usize];
37    ["Offset of field: async_state_t::reserved"]
38        [::core::mem::offset_of!(async_state_t, reserved) - 0usize];
39};
40pub type async_ops_version_t = u32;
41#[repr(C)]
42#[derive(Debug, Default, Copy, Clone)]
43pub struct async_ops {
44    pub version: async_ops_version_t,
45    pub reserved: u32,
46    pub v1: async_ops_v1,
47    pub v2: async_ops_v2,
48    pub v3: async_ops_v3,
49}
50#[repr(C)]
51#[derive(Debug, Default, Copy, Clone)]
52pub struct async_ops_v1 {
53    pub now: ::core::option::Option<
54        unsafe extern "C" fn(dispatcher: *mut async_dispatcher_t) -> zx_time_t,
55    >,
56    pub begin_wait: ::core::option::Option<
57        unsafe extern "C" fn(
58            dispatcher: *mut async_dispatcher_t,
59            wait: *mut async_wait_t,
60        ) -> zx_status_t,
61    >,
62    pub cancel_wait: ::core::option::Option<
63        unsafe extern "C" fn(
64            dispatcher: *mut async_dispatcher_t,
65            wait: *mut async_wait_t,
66        ) -> zx_status_t,
67    >,
68    pub post_task: ::core::option::Option<
69        unsafe extern "C" fn(
70            dispatcher: *mut async_dispatcher_t,
71            task: *mut async_task_t,
72        ) -> zx_status_t,
73    >,
74    pub cancel_task: ::core::option::Option<
75        unsafe extern "C" fn(
76            dispatcher: *mut async_dispatcher_t,
77            task: *mut async_task_t,
78        ) -> zx_status_t,
79    >,
80    pub queue_packet: ::core::option::Option<
81        unsafe extern "C" fn(
82            dispatcher: *mut async_dispatcher_t,
83            receiver: *mut async_receiver_t,
84            data: *const zx_packet_user_t,
85        ) -> zx_status_t,
86    >,
87    pub set_guest_bell_trap: ::core::option::Option<
88        unsafe extern "C" fn(
89            dispatcher: *mut async_dispatcher_t,
90            trap: *mut async_guest_bell_trap_t,
91            guest: zx_handle_t,
92            addr: zx_vaddr_t,
93            length: usize,
94        ) -> zx_status_t,
95    >,
96}
97#[allow(clippy::unnecessary_operation, clippy::identity_op)]
98const _: () = {
99    ["Size of async_ops_v1"][::core::mem::size_of::<async_ops_v1>() - 56usize];
100    ["Alignment of async_ops_v1"][::core::mem::align_of::<async_ops_v1>() - 8usize];
101    ["Offset of field: async_ops_v1::now"][::core::mem::offset_of!(async_ops_v1, now) - 0usize];
102    ["Offset of field: async_ops_v1::begin_wait"]
103        [::core::mem::offset_of!(async_ops_v1, begin_wait) - 8usize];
104    ["Offset of field: async_ops_v1::cancel_wait"]
105        [::core::mem::offset_of!(async_ops_v1, cancel_wait) - 16usize];
106    ["Offset of field: async_ops_v1::post_task"]
107        [::core::mem::offset_of!(async_ops_v1, post_task) - 24usize];
108    ["Offset of field: async_ops_v1::cancel_task"]
109        [::core::mem::offset_of!(async_ops_v1, cancel_task) - 32usize];
110    ["Offset of field: async_ops_v1::queue_packet"]
111        [::core::mem::offset_of!(async_ops_v1, queue_packet) - 40usize];
112    ["Offset of field: async_ops_v1::set_guest_bell_trap"]
113        [::core::mem::offset_of!(async_ops_v1, set_guest_bell_trap) - 48usize];
114};
115#[repr(C)]
116#[derive(Debug, Default, Copy, Clone)]
117pub struct async_ops_v2 {
118    pub bind_irq: ::core::option::Option<
119        unsafe extern "C" fn(
120            dispatcher: *mut async_dispatcher_t,
121            irq: *mut async_irq_t,
122        ) -> zx_status_t,
123    >,
124    pub unbind_irq: ::core::option::Option<
125        unsafe extern "C" fn(
126            dispatcher: *mut async_dispatcher_t,
127            irq: *mut async_irq_t,
128        ) -> zx_status_t,
129    >,
130    pub create_paged_vmo: ::core::option::Option<
131        unsafe extern "C" fn(
132            dispatcher: *mut async_dispatcher_t,
133            paged_vmo: *mut async_paged_vmo_t,
134            options: u32,
135            pager: zx_handle_t,
136            vmo_size: u64,
137            vmo_out: *mut zx_handle_t,
138        ) -> zx_status_t,
139    >,
140    pub detach_paged_vmo: ::core::option::Option<
141        unsafe extern "C" fn(
142            dispatcher: *mut async_dispatcher_t,
143            paged_vmo: *mut async_paged_vmo_t,
144        ) -> zx_status_t,
145    >,
146}
147#[allow(clippy::unnecessary_operation, clippy::identity_op)]
148const _: () = {
149    ["Size of async_ops_v2"][::core::mem::size_of::<async_ops_v2>() - 32usize];
150    ["Alignment of async_ops_v2"][::core::mem::align_of::<async_ops_v2>() - 8usize];
151    ["Offset of field: async_ops_v2::bind_irq"]
152        [::core::mem::offset_of!(async_ops_v2, bind_irq) - 0usize];
153    ["Offset of field: async_ops_v2::unbind_irq"]
154        [::core::mem::offset_of!(async_ops_v2, unbind_irq) - 8usize];
155    ["Offset of field: async_ops_v2::create_paged_vmo"]
156        [::core::mem::offset_of!(async_ops_v2, create_paged_vmo) - 16usize];
157    ["Offset of field: async_ops_v2::detach_paged_vmo"]
158        [::core::mem::offset_of!(async_ops_v2, detach_paged_vmo) - 24usize];
159};
160#[repr(C)]
161#[derive(Debug, Default, Copy, Clone)]
162pub struct async_ops_v3 {
163    pub get_sequence_id: ::core::option::Option<
164        unsafe extern "C" fn(
165            dispatcher: *mut async_dispatcher_t,
166            out_sequence_id: *mut async_sequence_id_t,
167            out_error: *mut *const ::core::ffi::c_char,
168        ) -> zx_status_t,
169    >,
170    pub check_sequence_id: ::core::option::Option<
171        unsafe extern "C" fn(
172            dispatcher: *mut async_dispatcher_t,
173            sequence_id: async_sequence_id_t,
174            out_error: *mut *const ::core::ffi::c_char,
175        ) -> zx_status_t,
176    >,
177}
178#[allow(clippy::unnecessary_operation, clippy::identity_op)]
179const _: () = {
180    ["Size of async_ops_v3"][::core::mem::size_of::<async_ops_v3>() - 16usize];
181    ["Alignment of async_ops_v3"][::core::mem::align_of::<async_ops_v3>() - 8usize];
182    ["Offset of field: async_ops_v3::get_sequence_id"]
183        [::core::mem::offset_of!(async_ops_v3, get_sequence_id) - 0usize];
184    ["Offset of field: async_ops_v3::check_sequence_id"]
185        [::core::mem::offset_of!(async_ops_v3, check_sequence_id) - 8usize];
186};
187#[allow(clippy::unnecessary_operation, clippy::identity_op)]
188const _: () = {
189    ["Size of async_ops"][::core::mem::size_of::<async_ops>() - 112usize];
190    ["Alignment of async_ops"][::core::mem::align_of::<async_ops>() - 8usize];
191    ["Offset of field: async_ops::version"][::core::mem::offset_of!(async_ops, version) - 0usize];
192    ["Offset of field: async_ops::reserved"][::core::mem::offset_of!(async_ops, reserved) - 4usize];
193    ["Offset of field: async_ops::v1"][::core::mem::offset_of!(async_ops, v1) - 8usize];
194    ["Offset of field: async_ops::v2"][::core::mem::offset_of!(async_ops, v2) - 64usize];
195    ["Offset of field: async_ops::v3"][::core::mem::offset_of!(async_ops, v3) - 96usize];
196};
197pub type async_ops_t = async_ops;
198#[repr(C)]
199#[derive(Debug, Copy, Clone)]
200pub struct async_dispatcher {
201    pub ops: *const async_ops_t,
202}
203#[allow(clippy::unnecessary_operation, clippy::identity_op)]
204const _: () = {
205    ["Size of async_dispatcher"][::core::mem::size_of::<async_dispatcher>() - 8usize];
206    ["Alignment of async_dispatcher"][::core::mem::align_of::<async_dispatcher>() - 8usize];
207    ["Offset of field: async_dispatcher::ops"]
208        [::core::mem::offset_of!(async_dispatcher, ops) - 0usize];
209};
210impl Default for async_dispatcher {
211    fn default() -> Self {
212        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
213        unsafe {
214            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
215            s.assume_init()
216        }
217    }
218}
219pub type async_paged_vmo_handler_t = ::core::option::Option<
220    unsafe extern "C" fn(
221        dispatcher: *mut async_dispatcher_t,
222        paged_vmo: *mut async_paged_vmo_t,
223        status: zx_status_t,
224        request: *const zx_packet_page_request_t,
225    ),
226>;
227#[repr(C)]
228pub struct async_paged_vmo {
229    pub state: async_state_t,
230    pub handler: async_paged_vmo_handler_t,
231    pub pager: zx_handle_t,
232    pub vmo: zx_handle_t,
233}
234#[allow(clippy::unnecessary_operation, clippy::identity_op)]
235const _: () = {
236    ["Size of async_paged_vmo"][::core::mem::size_of::<async_paged_vmo>() - 32usize];
237    ["Alignment of async_paged_vmo"][::core::mem::align_of::<async_paged_vmo>() - 8usize];
238    ["Offset of field: async_paged_vmo::state"]
239        [::core::mem::offset_of!(async_paged_vmo, state) - 0usize];
240    ["Offset of field: async_paged_vmo::handler"]
241        [::core::mem::offset_of!(async_paged_vmo, handler) - 16usize];
242    ["Offset of field: async_paged_vmo::pager"]
243        [::core::mem::offset_of!(async_paged_vmo, pager) - 24usize];
244    ["Offset of field: async_paged_vmo::vmo"]
245        [::core::mem::offset_of!(async_paged_vmo, vmo) - 28usize];
246};
247impl Default for async_paged_vmo {
248    fn default() -> Self {
249        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
250        unsafe {
251            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
252            s.assume_init()
253        }
254    }
255}
256impl ::core::fmt::Debug for async_paged_vmo {
257    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
258        write!(f, "async_paged_vmo {{ state: {:?}, handler: {:?} }}", self.state, self.handler)
259    }
260}
261unsafe extern "C" {
262    pub fn async_create_paged_vmo(
263        dispatcher: *mut async_dispatcher_t,
264        paged_vmo: *mut async_paged_vmo_t,
265        options: u32,
266        pager: zx_handle_t,
267        vmo_size: u64,
268        vmo_out: *mut zx_handle_t,
269    ) -> zx_status_t;
270}
271unsafe extern "C" {
272    pub fn async_detach_paged_vmo(
273        dispatcher: *mut async_dispatcher_t,
274        paged_vmo: *mut async_paged_vmo_t,
275    ) -> zx_status_t;
276}
277pub type async_receiver_handler_t = ::core::option::Option<
278    unsafe extern "C" fn(
279        dispatcher: *mut async_dispatcher_t,
280        receiver: *mut async_receiver_t,
281        status: zx_status_t,
282        data: *const zx_packet_user_t,
283    ),
284>;
285#[repr(C)]
286#[derive(Debug, Default, Copy, Clone)]
287pub struct async_receiver {
288    pub state: async_state_t,
289    pub handler: async_receiver_handler_t,
290}
291#[allow(clippy::unnecessary_operation, clippy::identity_op)]
292const _: () = {
293    ["Size of async_receiver"][::core::mem::size_of::<async_receiver>() - 24usize];
294    ["Alignment of async_receiver"][::core::mem::align_of::<async_receiver>() - 8usize];
295    ["Offset of field: async_receiver::state"]
296        [::core::mem::offset_of!(async_receiver, state) - 0usize];
297    ["Offset of field: async_receiver::handler"]
298        [::core::mem::offset_of!(async_receiver, handler) - 16usize];
299};
300unsafe extern "C" {
301    pub fn async_queue_packet(
302        dispatcher: *mut async_dispatcher_t,
303        receiver: *mut async_receiver_t,
304        data: *const zx_packet_user_t,
305    ) -> zx_status_t;
306}
307#[repr(C)]
308#[derive(Debug, Default, Copy, Clone)]
309pub struct async_sequence_id {
310    pub value: u64,
311}
312#[allow(clippy::unnecessary_operation, clippy::identity_op)]
313const _: () = {
314    ["Size of async_sequence_id"][::core::mem::size_of::<async_sequence_id>() - 8usize];
315    ["Alignment of async_sequence_id"][::core::mem::align_of::<async_sequence_id>() - 8usize];
316    ["Offset of field: async_sequence_id::value"]
317        [::core::mem::offset_of!(async_sequence_id, value) - 0usize];
318};
319unsafe extern "C" {
320    pub fn async_get_sequence_id(
321        dispatcher: *mut async_dispatcher_t,
322        out_sequence_id: *mut async_sequence_id_t,
323        out_error: *mut *const ::core::ffi::c_char,
324    ) -> zx_status_t;
325}
326unsafe extern "C" {
327    pub fn async_check_sequence_id(
328        dispatcher: *mut async_dispatcher_t,
329        sequence_id: async_sequence_id_t,
330        out_error: *mut *const ::core::ffi::c_char,
331    ) -> zx_status_t;
332}
333pub type async_task_handler_t = ::core::option::Option<
334    unsafe extern "C" fn(
335        dispatcher: *mut async_dispatcher_t,
336        task: *mut async_task_t,
337        status: zx_status_t,
338    ),
339>;
340#[repr(C)]
341pub struct async_task {
342    pub state: async_state_t,
343    pub handler: async_task_handler_t,
344    pub deadline: zx_time_t,
345}
346#[allow(clippy::unnecessary_operation, clippy::identity_op)]
347const _: () = {
348    ["Size of async_task"][::core::mem::size_of::<async_task>() - 32usize];
349    ["Alignment of async_task"][::core::mem::align_of::<async_task>() - 8usize];
350    ["Offset of field: async_task::state"][::core::mem::offset_of!(async_task, state) - 0usize];
351    ["Offset of field: async_task::handler"]
352        [::core::mem::offset_of!(async_task, handler) - 16usize];
353    ["Offset of field: async_task::deadline"]
354        [::core::mem::offset_of!(async_task, deadline) - 24usize];
355};
356impl Default for async_task {
357    fn default() -> Self {
358        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
359        unsafe {
360            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
361            s.assume_init()
362        }
363    }
364}
365impl ::core::fmt::Debug for async_task {
366    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
367        write!(f, "async_task {{ state: {:?}, handler: {:?} }}", self.state, self.handler)
368    }
369}
370unsafe extern "C" {
371    pub fn async_post_task(
372        dispatcher: *mut async_dispatcher_t,
373        task: *mut async_task_t,
374    ) -> zx_status_t;
375}
376unsafe extern "C" {
377    pub fn async_cancel_task(
378        dispatcher: *mut async_dispatcher_t,
379        task: *mut async_task_t,
380    ) -> zx_status_t;
381}
382unsafe extern "C" {
383    pub fn async_now(dispatcher: *mut async_dispatcher_t) -> zx_time_t;
384}
385pub type async_guest_bell_trap_handler_t = ::core::option::Option<
386    unsafe extern "C" fn(
387        dispatcher: *mut async_dispatcher_t,
388        trap: *mut async_guest_bell_trap_t,
389        status: zx_status_t,
390        bell: *const zx_packet_guest_bell_t,
391    ),
392>;
393#[repr(C)]
394#[derive(Debug, Default, Copy, Clone)]
395pub struct async_guest_bell_trap {
396    pub state: async_state_t,
397    pub handler: async_guest_bell_trap_handler_t,
398}
399#[allow(clippy::unnecessary_operation, clippy::identity_op)]
400const _: () = {
401    ["Size of async_guest_bell_trap"][::core::mem::size_of::<async_guest_bell_trap>() - 24usize];
402    ["Alignment of async_guest_bell_trap"]
403        [::core::mem::align_of::<async_guest_bell_trap>() - 8usize];
404    ["Offset of field: async_guest_bell_trap::state"]
405        [::core::mem::offset_of!(async_guest_bell_trap, state) - 0usize];
406    ["Offset of field: async_guest_bell_trap::handler"]
407        [::core::mem::offset_of!(async_guest_bell_trap, handler) - 16usize];
408};
409unsafe extern "C" {
410    pub fn async_set_guest_bell_trap(
411        dispatcher: *mut async_dispatcher_t,
412        trap: *mut async_guest_bell_trap_t,
413        guest: zx_handle_t,
414        addr: zx_vaddr_t,
415        length: usize,
416    ) -> zx_status_t;
417}
418pub type async_wait_handler_t = ::core::option::Option<
419    unsafe extern "C" fn(
420        dispatcher: *mut async_dispatcher_t,
421        wait: *mut async_wait_t,
422        status: zx_status_t,
423        signal: *const zx_packet_signal_t,
424    ),
425>;
426#[repr(C)]
427pub struct async_wait {
428    pub state: async_state_t,
429    pub handler: async_wait_handler_t,
430    pub object: zx_handle_t,
431    pub trigger: zx_signals_t,
432    pub options: u32,
433}
434#[allow(clippy::unnecessary_operation, clippy::identity_op)]
435const _: () = {
436    ["Size of async_wait"][::core::mem::size_of::<async_wait>() - 40usize];
437    ["Alignment of async_wait"][::core::mem::align_of::<async_wait>() - 8usize];
438    ["Offset of field: async_wait::state"][::core::mem::offset_of!(async_wait, state) - 0usize];
439    ["Offset of field: async_wait::handler"]
440        [::core::mem::offset_of!(async_wait, handler) - 16usize];
441    ["Offset of field: async_wait::object"][::core::mem::offset_of!(async_wait, object) - 24usize];
442    ["Offset of field: async_wait::trigger"]
443        [::core::mem::offset_of!(async_wait, trigger) - 28usize];
444    ["Offset of field: async_wait::options"]
445        [::core::mem::offset_of!(async_wait, options) - 32usize];
446};
447impl Default for async_wait {
448    fn default() -> Self {
449        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
450        unsafe {
451            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
452            s.assume_init()
453        }
454    }
455}
456impl ::core::fmt::Debug for async_wait {
457    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
458        write!(f, "async_wait {{ state: {:?}, handler: {:?} }}", self.state, self.handler)
459    }
460}
461unsafe extern "C" {
462    pub fn async_begin_wait(
463        dispatcher: *mut async_dispatcher_t,
464        wait: *mut async_wait_t,
465    ) -> zx_status_t;
466}
467unsafe extern "C" {
468    pub fn async_cancel_wait(
469        dispatcher: *mut async_dispatcher_t,
470        wait: *mut async_wait_t,
471    ) -> zx_status_t;
472}
473pub type fdf_handle_t = zx_handle_t;
474pub type fdf_txid_t = zx_txid_t;
475#[repr(C)]
476#[derive(Debug, Copy, Clone)]
477pub struct fdf_arena {
478    _unused: [u8; 0],
479}
480#[repr(C)]
481#[derive(Debug, Copy, Clone)]
482pub struct fdf_channel_call_args {
483    pub wr_arena: *mut fdf_arena,
484    pub wr_data: *mut ::core::ffi::c_void,
485    pub wr_num_bytes: u32,
486    pub wr_handles: *mut zx_handle_t,
487    pub wr_num_handles: u32,
488    pub rd_arena: *mut *mut fdf_arena,
489    pub rd_data: *mut *mut ::core::ffi::c_void,
490    pub rd_num_bytes: *mut u32,
491    pub rd_handles: *mut *mut zx_handle_t,
492    pub rd_num_handles: *mut u32,
493}
494#[allow(clippy::unnecessary_operation, clippy::identity_op)]
495const _: () = {
496    ["Size of fdf_channel_call_args"][::core::mem::size_of::<fdf_channel_call_args>() - 80usize];
497    ["Alignment of fdf_channel_call_args"]
498        [::core::mem::align_of::<fdf_channel_call_args>() - 8usize];
499    ["Offset of field: fdf_channel_call_args::wr_arena"]
500        [::core::mem::offset_of!(fdf_channel_call_args, wr_arena) - 0usize];
501    ["Offset of field: fdf_channel_call_args::wr_data"]
502        [::core::mem::offset_of!(fdf_channel_call_args, wr_data) - 8usize];
503    ["Offset of field: fdf_channel_call_args::wr_num_bytes"]
504        [::core::mem::offset_of!(fdf_channel_call_args, wr_num_bytes) - 16usize];
505    ["Offset of field: fdf_channel_call_args::wr_handles"]
506        [::core::mem::offset_of!(fdf_channel_call_args, wr_handles) - 24usize];
507    ["Offset of field: fdf_channel_call_args::wr_num_handles"]
508        [::core::mem::offset_of!(fdf_channel_call_args, wr_num_handles) - 32usize];
509    ["Offset of field: fdf_channel_call_args::rd_arena"]
510        [::core::mem::offset_of!(fdf_channel_call_args, rd_arena) - 40usize];
511    ["Offset of field: fdf_channel_call_args::rd_data"]
512        [::core::mem::offset_of!(fdf_channel_call_args, rd_data) - 48usize];
513    ["Offset of field: fdf_channel_call_args::rd_num_bytes"]
514        [::core::mem::offset_of!(fdf_channel_call_args, rd_num_bytes) - 56usize];
515    ["Offset of field: fdf_channel_call_args::rd_handles"]
516        [::core::mem::offset_of!(fdf_channel_call_args, rd_handles) - 64usize];
517    ["Offset of field: fdf_channel_call_args::rd_num_handles"]
518        [::core::mem::offset_of!(fdf_channel_call_args, rd_num_handles) - 72usize];
519};
520impl Default for fdf_channel_call_args {
521    fn default() -> Self {
522        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
523        unsafe {
524            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
525            s.assume_init()
526        }
527    }
528}
529pub type fdf_channel_call_args_t = fdf_channel_call_args;
530pub type fdf_arena_t = fdf_arena;
531pub type fdf_arena_tag_t = u32;
532unsafe extern "C" {
533    pub fn fdf_arena_create(
534        options: u32,
535        tag: fdf_arena_tag_t,
536        out_arena: *mut *mut fdf_arena_t,
537    ) -> zx_status_t;
538}
539unsafe extern "C" {
540    pub fn fdf_arena_allocate(arena: *mut fdf_arena_t, bytes: usize) -> *mut ::core::ffi::c_void;
541}
542unsafe extern "C" {
543    pub fn fdf_arena_free(arena: *mut fdf_arena_t, ptr: *mut ::core::ffi::c_void);
544}
545unsafe extern "C" {
546    pub fn fdf_arena_contains(
547        arena: *mut fdf_arena_t,
548        ptr: *const ::core::ffi::c_void,
549        num_bytes: usize,
550    ) -> bool;
551}
552unsafe extern "C" {
553    pub fn fdf_arena_add_ref(arena: *mut fdf_arena_t);
554}
555unsafe extern "C" {
556    pub fn fdf_arena_drop_ref(arena: *mut fdf_arena_t);
557}
558#[repr(C)]
559#[derive(Debug, Copy, Clone)]
560pub struct fdf_dispatcher {
561    _unused: [u8; 0],
562}
563pub type fdf_dispatcher_t = fdf_dispatcher;
564pub type fdf_dispatcher_shutdown_observer_t = fdf_dispatcher_shutdown_observer;
565pub type fdf_dispatcher_shutdown_handler_t = ::core::option::Option<
566    unsafe extern "C" fn(
567        dispatcher: *mut fdf_dispatcher_t,
568        observer: *mut fdf_dispatcher_shutdown_observer_t,
569    ),
570>;
571#[repr(C)]
572#[derive(Debug, Default, Copy, Clone)]
573pub struct fdf_dispatcher_shutdown_observer {
574    pub handler: fdf_dispatcher_shutdown_handler_t,
575}
576#[allow(clippy::unnecessary_operation, clippy::identity_op)]
577const _: () = {
578    ["Size of fdf_dispatcher_shutdown_observer"]
579        [::core::mem::size_of::<fdf_dispatcher_shutdown_observer>() - 8usize];
580    ["Alignment of fdf_dispatcher_shutdown_observer"]
581        [::core::mem::align_of::<fdf_dispatcher_shutdown_observer>() - 8usize];
582    ["Offset of field: fdf_dispatcher_shutdown_observer::handler"]
583        [::core::mem::offset_of!(fdf_dispatcher_shutdown_observer, handler) - 0usize];
584};
585unsafe extern "C" {
586    pub fn fdf_dispatcher_create(
587        options: u32,
588        name: *const ::core::ffi::c_char,
589        name_len: usize,
590        scheduler_role: *const ::core::ffi::c_char,
591        scheduler_role_len: usize,
592        observer: *mut fdf_dispatcher_shutdown_observer_t,
593        out_dispatcher: *mut *mut fdf_dispatcher_t,
594    ) -> zx_status_t;
595}
596unsafe extern "C" {
597    pub fn fdf_dispatcher_get_async_dispatcher(
598        dispatcher: *mut fdf_dispatcher_t,
599    ) -> *mut async_dispatcher_t;
600}
601unsafe extern "C" {
602    pub fn fdf_dispatcher_downcast_async_dispatcher(
603        async_dispatcher: *mut async_dispatcher_t,
604    ) -> *mut fdf_dispatcher_t;
605}
606unsafe extern "C" {
607    pub fn fdf_dispatcher_get_current_dispatcher() -> *mut fdf_dispatcher_t;
608}
609unsafe extern "C" {
610    pub fn fdf_dispatcher_get_options(dispatcher: *const fdf_dispatcher_t) -> u32;
611}
612unsafe extern "C" {
613    pub fn fdf_dispatcher_shutdown_async(dispatcher: *mut fdf_dispatcher_t);
614}
615unsafe extern "C" {
616    pub fn fdf_dispatcher_destroy(dispatcher: *mut fdf_dispatcher_t);
617}
618unsafe extern "C" {
619    pub fn fdf_dispatcher_seal(dispatcher: *mut fdf_dispatcher_t, option: u32) -> zx_status_t;
620}
621unsafe extern "C" {
622    pub fn fdf_handle_close(handle: fdf_handle_t);
623}
624unsafe extern "C" {
625    pub fn fdf_channel_create(
626        options: u32,
627        out0: *mut fdf_handle_t,
628        out1: *mut fdf_handle_t,
629    ) -> zx_status_t;
630}
631unsafe extern "C" {
632    pub fn fdf_channel_write(
633        channel: fdf_handle_t,
634        options: u32,
635        arena: *mut fdf_arena_t,
636        data: *mut ::core::ffi::c_void,
637        num_bytes: u32,
638        handles: *mut zx_handle_t,
639        num_handles: u32,
640    ) -> zx_status_t;
641}
642unsafe extern "C" {
643    pub fn fdf_channel_read(
644        channel: fdf_handle_t,
645        options: u32,
646        out_arena: *mut *mut fdf_arena_t,
647        out_data: *mut *mut ::core::ffi::c_void,
648        out_num_bytes: *mut u32,
649        out_handles: *mut *mut zx_handle_t,
650        out_num_handles: *mut u32,
651    ) -> zx_status_t;
652}
653unsafe extern "C" {
654    pub fn fdf_channel_wait_async(
655        dispatcher: *mut fdf_dispatcher,
656        channel_read: *mut fdf_channel_read,
657        options: u32,
658    ) -> zx_status_t;
659}
660unsafe extern "C" {
661    pub fn fdf_channel_cancel_wait(handle: fdf_handle_t) -> zx_status_t;
662}
663unsafe extern "C" {
664    pub fn fdf_channel_call(
665        handle: fdf_handle_t,
666        options: u32,
667        deadline: zx_time_t,
668        args: *const fdf_channel_call_args_t,
669    ) -> zx_status_t;
670}
671pub type fdf_channel_read_t = fdf_channel_read;
672pub type fdf_channel_read_handler_t = ::core::option::Option<
673    unsafe extern "C" fn(
674        dispatcher: *mut fdf_dispatcher_t,
675        read: *mut fdf_channel_read_t,
676        status: zx_status_t,
677    ),
678>;
679#[repr(C)]
680pub struct fdf_channel_read {
681    pub state: async_state_t,
682    pub handler: fdf_channel_read_handler_t,
683    pub channel: fdf_handle_t,
684    pub options: u32,
685}
686#[allow(clippy::unnecessary_operation, clippy::identity_op)]
687const _: () = {
688    ["Size of fdf_channel_read"][::core::mem::size_of::<fdf_channel_read>() - 32usize];
689    ["Alignment of fdf_channel_read"][::core::mem::align_of::<fdf_channel_read>() - 8usize];
690    ["Offset of field: fdf_channel_read::state"]
691        [::core::mem::offset_of!(fdf_channel_read, state) - 0usize];
692    ["Offset of field: fdf_channel_read::handler"]
693        [::core::mem::offset_of!(fdf_channel_read, handler) - 16usize];
694    ["Offset of field: fdf_channel_read::channel"]
695        [::core::mem::offset_of!(fdf_channel_read, channel) - 24usize];
696    ["Offset of field: fdf_channel_read::options"]
697        [::core::mem::offset_of!(fdf_channel_read, options) - 28usize];
698};
699impl Default for fdf_channel_read {
700    fn default() -> Self {
701        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
702        unsafe {
703            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
704            s.assume_init()
705        }
706    }
707}
708impl ::core::fmt::Debug for fdf_channel_read {
709    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
710        write!(f, "fdf_channel_read {{ state: {:?}, handler: {:?} }}", self.state, self.handler)
711    }
712}
713pub type fdf_env_driver_shutdown_observer_t = fdf_env_driver_shutdown_observer;
714pub type fdf_env_driver_shutdown_handler_t = ::core::option::Option<
715    unsafe extern "C" fn(
716        driver: *const ::core::ffi::c_void,
717        observer: *mut fdf_env_driver_shutdown_observer_t,
718    ),
719>;
720#[repr(C)]
721#[derive(Debug, Default, Copy, Clone)]
722pub struct fdf_env_driver_shutdown_observer {
723    pub handler: fdf_env_driver_shutdown_handler_t,
724}
725#[allow(clippy::unnecessary_operation, clippy::identity_op)]
726const _: () = {
727    ["Size of fdf_env_driver_shutdown_observer"]
728        [::core::mem::size_of::<fdf_env_driver_shutdown_observer>() - 8usize];
729    ["Alignment of fdf_env_driver_shutdown_observer"]
730        [::core::mem::align_of::<fdf_env_driver_shutdown_observer>() - 8usize];
731    ["Offset of field: fdf_env_driver_shutdown_observer::handler"]
732        [::core::mem::offset_of!(fdf_env_driver_shutdown_observer, handler) - 0usize];
733};
734unsafe extern "C" {
735    pub fn fdf_env_start(options: u32) -> zx_status_t;
736}
737unsafe extern "C" {
738    pub fn fdf_env_reset();
739}
740unsafe extern "C" {
741    pub fn fdf_env_dispatcher_create_with_owner(
742        driver: *const ::core::ffi::c_void,
743        options: u32,
744        name: *const ::core::ffi::c_char,
745        name_len: usize,
746        scheduler_role: *const ::core::ffi::c_char,
747        scheduler_role_len: usize,
748        observer: *mut fdf_dispatcher_shutdown_observer_t,
749        out_dispatcher: *mut *mut fdf_dispatcher_t,
750    ) -> zx_status_t;
751}
752unsafe extern "C" {
753    pub fn fdf_env_dispatcher_dump(dispatcher: *mut fdf_dispatcher_t);
754}
755unsafe extern "C" {
756    pub fn fdf_env_dispatcher_get_dump_deprecated(
757        dispatcher: *mut fdf_dispatcher_t,
758        out_dump: *mut *mut ::core::ffi::c_char,
759    );
760}
761unsafe extern "C" {
762    pub fn fdf_env_shutdown_dispatchers_async(
763        driver: *const ::core::ffi::c_void,
764        observer: *mut fdf_env_driver_shutdown_observer_t,
765    ) -> zx_status_t;
766}
767unsafe extern "C" {
768    pub fn fdf_env_destroy_all_dispatchers();
769}
770unsafe extern "C" {
771    pub fn fdf_env_register_driver_entry(driver: *const ::core::ffi::c_void);
772}
773unsafe extern "C" {
774    pub fn fdf_env_register_driver_exit();
775}
776unsafe extern "C" {
777    pub fn fdf_env_get_current_driver() -> *const ::core::ffi::c_void;
778}
779unsafe extern "C" {
780    pub fn fdf_env_dispatcher_has_queued_tasks(dispatcher: *mut fdf_dispatcher_t) -> bool;
781}
782unsafe extern "C" {
783    pub fn fdf_env_get_thread_limit(
784        scheduler_role: *const ::core::ffi::c_char,
785        scheduler_role_len: usize,
786    ) -> u32;
787}
788unsafe extern "C" {
789    pub fn fdf_env_set_thread_limit(
790        scheduler_role: *const ::core::ffi::c_char,
791        scheduler_role_len: usize,
792        max_threads: u32,
793    ) -> zx_status_t;
794}
795unsafe extern "C" {
796    pub fn fdf_env_add_allowed_scheduler_role_for_driver(
797        driver: *const ::core::ffi::c_void,
798        role: *const ::core::ffi::c_char,
799        role_length: usize,
800    );
801}
802unsafe extern "C" {
803    pub fn fdf_testing_create_unmanaged_dispatcher(
804        driver: *const ::core::ffi::c_void,
805        options: u32,
806        name: *const ::core::ffi::c_char,
807        name_len: usize,
808        observer: *mut fdf_dispatcher_shutdown_observer_t,
809        out_dispatcher: *mut *mut fdf_dispatcher_t,
810    ) -> zx_status_t;
811}
812unsafe extern "C" {
813    pub fn fdf_testing_set_default_dispatcher(dispatcher: *mut fdf_dispatcher_t) -> zx_status_t;
814}
815unsafe extern "C" {
816    pub fn fdf_testing_run(deadline: zx_time_t, once: bool) -> zx_status_t;
817}
818unsafe extern "C" {
819    pub fn fdf_testing_run_until_idle() -> zx_status_t;
820}
821unsafe extern "C" {
822    pub fn fdf_testing_quit();
823}
824unsafe extern "C" {
825    pub fn fdf_testing_reset_quit() -> zx_status_t;
826}
827pub type fdf_token_t = fdf_token;
828pub type fdf_token_transfer_handler_t = ::core::option::Option<
829    unsafe extern "C" fn(
830        dispatcher: *mut fdf_dispatcher_t,
831        token: *mut fdf_token_t,
832        status: zx_status_t,
833        handle: fdf_handle_t,
834    ),
835>;
836#[repr(C)]
837#[derive(Debug, Default, Copy, Clone)]
838pub struct fdf_token {
839    pub handler: fdf_token_transfer_handler_t,
840}
841#[allow(clippy::unnecessary_operation, clippy::identity_op)]
842const _: () = {
843    ["Size of fdf_token"][::core::mem::size_of::<fdf_token>() - 8usize];
844    ["Alignment of fdf_token"][::core::mem::align_of::<fdf_token>() - 8usize];
845    ["Offset of field: fdf_token::handler"][::core::mem::offset_of!(fdf_token, handler) - 0usize];
846};
847unsafe extern "C" {
848    pub fn fdf_token_register(
849        token: zx_handle_t,
850        dispatcher: *mut fdf_dispatcher_t,
851        handler: *mut fdf_token_t,
852    ) -> zx_status_t;
853}
854unsafe extern "C" {
855    pub fn fdf_token_transfer(token: zx_handle_t, handle: fdf_handle_t) -> zx_status_t;
856}
857#[repr(C)]
858#[derive(Debug, Default, Copy, Clone)]
859pub struct DriverRegistration {
860    pub version: u64,
861    pub v1: DriverRegistration_driver_registration_v1,
862}
863#[repr(C)]
864#[derive(Debug, Default, Copy, Clone)]
865pub struct DriverRegistration_driver_registration_v1 {
866    pub initialize: ::core::option::Option<
867        unsafe extern "C" fn(server_handle: fdf_handle_t) -> *mut ::core::ffi::c_void,
868    >,
869    pub destroy: ::core::option::Option<unsafe extern "C" fn(token: *mut ::core::ffi::c_void)>,
870}
871#[allow(clippy::unnecessary_operation, clippy::identity_op)]
872const _: () = {
873    ["Size of DriverRegistration_driver_registration_v1"]
874        [::core::mem::size_of::<DriverRegistration_driver_registration_v1>() - 16usize];
875    ["Alignment of DriverRegistration_driver_registration_v1"]
876        [::core::mem::align_of::<DriverRegistration_driver_registration_v1>() - 8usize];
877    ["Offset of field: DriverRegistration_driver_registration_v1::initialize"]
878        [::core::mem::offset_of!(DriverRegistration_driver_registration_v1, initialize) - 0usize];
879    ["Offset of field: DriverRegistration_driver_registration_v1::destroy"]
880        [::core::mem::offset_of!(DriverRegistration_driver_registration_v1, destroy) - 8usize];
881};
882#[allow(clippy::unnecessary_operation, clippy::identity_op)]
883const _: () = {
884    ["Size of DriverRegistration"][::core::mem::size_of::<DriverRegistration>() - 24usize];
885    ["Alignment of DriverRegistration"][::core::mem::align_of::<DriverRegistration>() - 8usize];
886    ["Offset of field: DriverRegistration::version"]
887        [::core::mem::offset_of!(DriverRegistration, version) - 0usize];
888    ["Offset of field: DriverRegistration::v1"]
889        [::core::mem::offset_of!(DriverRegistration, v1) - 8usize];
890};