blob: b965faf6cdd78a7ab4a4546519661a56f629cd35 [file] [log] [blame] [edit]
// 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.scheduler;
using zx;
// Corresponds to zx_cpu_set_t.
type CpuSet = struct {
mask array<uint64, 8>;
};
@discoverable
closed protocol ProfileProvider {
/// Obtain a profile handle.
///
/// TODO(fxbug.dev/40858): This API will be deprecated and removed in the future, use
/// SetProfileByRole instead.
strict GetProfile(struct {
priority uint32;
name string:64;
}) -> (resource struct {
status zx.Status;
profile zx.Handle:<PROFILE, optional>;
});
/// Obtain a deadline profile handle.
///
/// TODO(fxbug.dev/40858): This API will be deprecated and removed in the future, use
/// SetProfileByRole instead.
strict GetDeadlineProfile(struct {
capacity uint64;
deadline uint64;
period uint64;
name string:64;
}) -> (resource struct {
status zx.Status;
profile zx.Handle:<PROFILE, optional>;
});
/// Obtain a handle for a profile that sets CPU affinity.
///
/// TODO(fxbug.dev/40858): This API will be deprecated and removed in the future, use
/// SetProfileByRole instead.
strict GetCpuAffinityProfile(struct {
cpu_mask CpuSet;
}) -> (resource struct {
status zx.Status;
profile zx.Handle:<PROFILE, optional>;
});
/// Sets the given object's profile based on the requested role. The exact
/// parameters of the profile are system dependent and may vary based on
/// device-specific tuning and/or runtime system goals.
strict SetProfileByRole(resource struct {
handle zx.Handle;
role string:2048;
}) -> (struct {
status zx.Status;
});
};