blob: 6044c000e1326c9ea767398cd1f7874638500538 [file] [log] [blame]
// 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.
library zbi;
// TODO(https://fxbug.dev/42062786): Figure out documentation convention.
const PARTITION_NAME_LEN uint64 = 32;
const PARTITION_GUID_LEN uint64 = 16;
alias PartitionGuid = array<uint8, PARTITION_GUID_LEN>;
type Partition = struct {
/// GUID specifying the format and use of data stored in the partition.
type_guid PartitionGuid;
/// GUID unique to this partition.
uniq_guid PartitionGuid;
/// First and last block occupied by this partition.
first_block uint64;
last_block uint64;
/// Reserved for future use. Set to 0.
flags uint64;
name string_array<PARTITION_NAME_LEN>;
};
/// ZBI_TYPE_DRV_PARTITION_MAP payload. This header is immediately followed by
/// an array of the corresponding zbi_partition_t.
type PartitionMap = struct {
/// Total blocks used on the device.
block_count uint64;
/// Size of each block in bytes.
block_size uint64;
/// Number of partitions in the map.
partition_count uint32;
/// Reserved for future use.
reserved uint32;
/// Device GUID.
guid PartitionGuid;
};