| // 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. |
| |
| /// Unknown values should be treated as RESERVED to allow forwards compatibility. |
| type MemType = flexible enum : uint32 { |
| /// 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. |
| type MemRange = struct { |
| paddr uint64; |
| length uint64; |
| type MemType; |
| reserved uint32; |
| }; |
| |
| /// ZBI_TYPE_NVRAM payload. |
| type Nvram = struct { |
| base uint64; |
| length uint64; |
| }; |