fidl_data_zbi/
memory.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
12/// Unknown values should be treated as RESERVED to allow forwards compatibility.
13#[repr(u32)]
14#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
15pub enum MemType {
16    /// Standard RAM.
17    Ram = 1,
18
19    /// Device memory.
20    Peripheral = 2,
21
22    /// Represents memory that should not be used by the system. Reserved ranges may
23    /// overlap other RAM or PERIPHERAL regions, in which case the reserved range
24    /// should take precedence.
25    Reserved = 3,
26}
27
28/// The ZBI_TYPE_MEM_CONFIG payload consist of one or more `zbi_mem_range_t`
29/// entries.
30///
31/// The length of the item is `sizeof(zbi_mem_range_t)` times the number of
32/// entries. Each entry describes a contiguous range of memory
33///
34/// Entries in the table may be in any order, and only a single item of type
35/// ZBI_TYPE_MEM_CONFIG should be present in the ZBI.
36#[repr(C)]
37#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
38pub struct MemRange {
39    pub paddr: u64,
40    pub length: u64,
41    pub r#type: MemType,
42    pub reserved: u32,
43}
44
45/// ZBI_TYPE_NVRAM payload.
46#[repr(C)]
47#[derive(Clone, Copy, Debug, Eq, FromBytes, IntoBytes, PartialEq)]
48pub struct Nvram {
49    pub base: u64,
50    pub length: u64,
51}