blob: ad1f0ae05f5fca8c3414a1d2f0d1572a2a8aa8ed [file] [log] [blame]
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// fou0d in the LICENSE file.
library fuchsia.sysmem;
/// "SyM"
const uint32 SYSMEM_METADATA = 0x53794d64; // 0x53794d00 | DEVICE_METADATA_PRIVATE
struct SysmemMetadata {
uint32 vid;
uint32 pid;
// 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.
int64 protected_memory_size;
// 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.
int64 contiguous_memory_size;
};