fidl_data_zbi/partition.rs
1// Copyright 2022 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// DO NOT EDIT.
6// Generated from FIDL library `zbi` by zither, a Fuchsia platform tool.
7
8#![allow(unused_imports)]
9
10use zerocopy::{FromBytes, IntoBytes};
11
12pub const PARTITION_NAME_LEN: u64 = 32;
13
14pub const PARTITION_GUID_LEN: u64 = 16;
15
16pub type PartitionGuid = [u8; 16];
17
18#[repr(C)]
19#[derive(Clone, Copy, Debug, Eq, FromBytes, IntoBytes, PartialEq)]
20pub struct Partition {
21 /// GUID specifying the format and use of data stored in the partition.
22 pub type_guid: PartitionGuid,
23
24 /// GUID unique to this partition.
25 pub uniq_guid: PartitionGuid,
26
27 /// First and last block occupied by this partition.
28 pub first_block: u64,
29 pub last_block: u64,
30
31 /// Reserved for future use. Set to 0.
32 pub flags: u64,
33 pub name: [u8; 32],
34}
35
36/// ZBI_TYPE_DRV_PARTITION_MAP payload. This header is immediately followed by
37/// an array of the corresponding zbi_partition_t.
38#[repr(C)]
39#[derive(Clone, Copy, Debug, Eq, FromBytes, IntoBytes, PartialEq)]
40pub struct PartitionMap {
41 /// Total blocks used on the device.
42 pub block_count: u64,
43
44 /// Size of each block in bytes.
45 pub block_size: u64,
46
47 /// Number of partitions in the map.
48 pub partition_count: u32,
49
50 /// Reserved for future use.
51 pub reserved: u32,
52
53 /// Device GUID.
54 pub guid: PartitionGuid,
55}