| // Copyright 2021 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 fuchsia.sysmem; |
| |
| /// "SyM" |
| const SYSMEM_METADATA_TYPE uint32 = 0x53794d64; // 0x53794d00 | DEVICE_METADATA_PRIVATE |
| type SysmemMetadata = struct { |
| vid uint32; |
| pid uint32; |
| |
| // protected_memory_size |
| // contiguous_memory_size |
| // |
| // Positive values are interpreted as bytes, and are aligned up to next |
| // ZX_PAGE_SIZE. |
| // |
| // Negative values are interpreted as a percentage of physical memory (after |
| // negation), and resulting size in bytes is aligned up to next ZX_PAGE_SIZE. |
| |
| // protected_memory_size |
| // |
| // Size of the protected memory pool. See above for how this value is |
| // interpreted. |
| // |
| // 0 means there is no protected memory pool. |
| protected_memory_size int64; |
| |
| // contiguous_memory_size |
| // |
| // Size of the pool used to allocate contiguous memory. See above for how |
| // this value is interpreted. |
| // |
| // Zero means no space is reserved up front, which will end up using |
| // zx::vmo::create_contiguous() for each allocation instead of allocating up |
| // front, which can be prone to failure when physical memory becomes |
| // fragmented. |
| // |
| // There is no fallback from pre-reserved to zx::vmo::create_contiguous(). |
| // If we're pre-reserving memory, we should reserve enough. |
| contiguous_memory_size int64; |
| }; |