1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/* automatically generated by rust-bindgen 0.69.4 */

// Copyright 2023 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 src/storage/lib/block_protocol/scripts/bindgen.sh
// Run the above script whenever src/devices/block/drivers/core/block-fifo.h
// has changed.

#![allow(dead_code)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]

use zerocopy::{FromBytes, Immutable, IntoBytes, KnownLayout};

pub type zx_status_t = i32;
pub type reqid_t = u32;
pub type groupid_t = u16;
pub type vmoid_t = u16;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct BlockFifoCommand {
    pub opcode: u8,
    pub padding_to_satisfy_zerocopy: [u8; 3usize],
    pub flags: u32,
}
const _: () = {
    ["Size of BlockFifoCommand"][::std::mem::size_of::<BlockFifoCommand>() - 8usize];
    ["Alignment of BlockFifoCommand"][::std::mem::align_of::<BlockFifoCommand>() - 4usize];
    ["Offset of field: BlockFifoCommand::opcode"]
        [::std::mem::offset_of!(BlockFifoCommand, opcode) - 0usize];
    ["Offset of field: BlockFifoCommand::padding_to_satisfy_zerocopy"]
        [::std::mem::offset_of!(BlockFifoCommand, padding_to_satisfy_zerocopy) - 1usize];
    ["Offset of field: BlockFifoCommand::flags"]
        [::std::mem::offset_of!(BlockFifoCommand, flags) - 4usize];
};
pub type block_fifo_command_t = BlockFifoCommand;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct BlockFifoRequest {
    pub command: block_fifo_command_t,
    pub reqid: reqid_t,
    pub group: groupid_t,
    pub vmoid: vmoid_t,
    pub length: u32,
    pub padding_to_satisfy_zerocopy: u32,
    pub vmo_offset: u64,
    pub dev_offset: u64,
    pub trace_flow_id: u64,
}
const _: () = {
    ["Size of BlockFifoRequest"][::std::mem::size_of::<BlockFifoRequest>() - 48usize];
    ["Alignment of BlockFifoRequest"][::std::mem::align_of::<BlockFifoRequest>() - 8usize];
    ["Offset of field: BlockFifoRequest::command"]
        [::std::mem::offset_of!(BlockFifoRequest, command) - 0usize];
    ["Offset of field: BlockFifoRequest::reqid"]
        [::std::mem::offset_of!(BlockFifoRequest, reqid) - 8usize];
    ["Offset of field: BlockFifoRequest::group"]
        [::std::mem::offset_of!(BlockFifoRequest, group) - 12usize];
    ["Offset of field: BlockFifoRequest::vmoid"]
        [::std::mem::offset_of!(BlockFifoRequest, vmoid) - 14usize];
    ["Offset of field: BlockFifoRequest::length"]
        [::std::mem::offset_of!(BlockFifoRequest, length) - 16usize];
    ["Offset of field: BlockFifoRequest::padding_to_satisfy_zerocopy"]
        [::std::mem::offset_of!(BlockFifoRequest, padding_to_satisfy_zerocopy) - 20usize];
    ["Offset of field: BlockFifoRequest::vmo_offset"]
        [::std::mem::offset_of!(BlockFifoRequest, vmo_offset) - 24usize];
    ["Offset of field: BlockFifoRequest::dev_offset"]
        [::std::mem::offset_of!(BlockFifoRequest, dev_offset) - 32usize];
    ["Offset of field: BlockFifoRequest::trace_flow_id"]
        [::std::mem::offset_of!(BlockFifoRequest, trace_flow_id) - 40usize];
};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct BlockFifoResponse {
    pub status: zx_status_t,
    pub reqid: reqid_t,
    pub group: groupid_t,
    pub padding_to_satisfy_zerocopy: u16,
    pub count: u32,
    pub padding_to_match_request_size_and_alignment: [u64; 4usize],
}
const _: () = {
    ["Size of BlockFifoResponse"][::std::mem::size_of::<BlockFifoResponse>() - 48usize];
    ["Alignment of BlockFifoResponse"][::std::mem::align_of::<BlockFifoResponse>() - 8usize];
    ["Offset of field: BlockFifoResponse::status"]
        [::std::mem::offset_of!(BlockFifoResponse, status) - 0usize];
    ["Offset of field: BlockFifoResponse::reqid"]
        [::std::mem::offset_of!(BlockFifoResponse, reqid) - 4usize];
    ["Offset of field: BlockFifoResponse::group"]
        [::std::mem::offset_of!(BlockFifoResponse, group) - 8usize];
    ["Offset of field: BlockFifoResponse::padding_to_satisfy_zerocopy"]
        [::std::mem::offset_of!(BlockFifoResponse, padding_to_satisfy_zerocopy) - 10usize];
    ["Offset of field: BlockFifoResponse::count"]
        [::std::mem::offset_of!(BlockFifoResponse, count) - 12usize];
    ["Offset of field: BlockFifoResponse::padding_to_match_request_size_and_alignment"][::std::mem::offset_of!(
        BlockFifoResponse,
        padding_to_match_request_size_and_alignment
    )
        - 16usize];
};