blob: bf74845d75ec92a54397a28b9bd241bf9e831295 [file] [log] [blame]
// Copyright 2019 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.boot;
using zx;
const MAX_FILE_NAME_LENGTH uint8 = 255;
/// Protocol for retrieving boot item payloads.
@discoverable
closed protocol Items {
/// Get a `payload` for a boot item of `type` and `extra`.
/// NOTE: We return the `length` of the item, as VMOs must be page-aligned.
///
/// TODO: Refactor API: https://fxbug.dev/42109921
///
/// For a list of `type`s, refer to <lib/zbi-format/zbi.h>.
/// For a list of `extra`s, refer to <lib/zbi-format/driver-config.h>.
strict Get(struct {
type uint32;
extra uint32;
}) -> (resource struct {
payload zx.Handle:<VMO, optional>;
length uint32;
});
/// Get all stored items of `type`, optionally also restricted by `extra`. Note that
/// length is returned for each item as VMOs are page-aligned.
///
/// Returns ZX_ERR_NOT_SUPPORTED if this is an untracked item which will never be stored.
strict Get2(struct {
type uint32;
extra box<struct {
n uint32;
}>;
}) -> (resource struct {
retrieved_items vector<resource struct {
payload zx.Handle:VMO;
length uint32;
extra uint32;
}>:MAX;
}) error zx.Status;
/// Gets the `payload` for a `ZBI_TYPE_BOOTLOADER_FILE` boot item.
/// Note: ZX_PROP_VMO_CONTENT_SIZE will be set to the actual file content size
strict GetBootloaderFile(struct {
filename string:MAX_FILE_NAME_LENGTH;
}) -> (resource struct {
payload zx.Handle:<VMO, optional>;
});
};