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
// Copyright 2022 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.

// DO NOT EDIT.
// Generated from FIDL library `zbi` by zither, a Fuchsia platform tool.

#![allow(unused_imports)]

use zerocopy::{FromBytes, IntoBytes};

/// Unknown values should be treated as RESERVED to allow forwards compatibility.
#[repr(u32)]
#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
pub enum MemType {
    /// Standard RAM.
    Ram = 1,

    /// Device memory.
    Peripheral = 2,

    /// Represents memory that should not be used by the system. Reserved ranges may
    /// overlap other RAM or PERIPHERAL regions, in which case the reserved range
    /// should take precedence.
    Reserved = 3,
}

/// The ZBI_TYPE_MEM_CONFIG payload consist of one or more `zbi_mem_range_t`
/// entries.
///
/// The length of the item is `sizeof(zbi_mem_range_t)` times the number of
/// entries. Each entry describes a contiguous range of memory
///
/// Entries in the table may be in any order, and only a single item of type
/// ZBI_TYPE_MEM_CONFIG should be present in the ZBI.
#[repr(C)]
#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
pub struct MemRange {
    pub paddr: u64,
    pub length: u64,
    pub r#type: MemType,
    pub reserved: u32,
}

/// ZBI_TYPE_NVRAM payload.
#[repr(C)]
#[derive(Clone, Copy, Debug, Eq, FromBytes, IntoBytes, PartialEq)]
pub struct Nvram {
    pub base: u64,
    pub length: u64,
}