| // 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.hardware.cpu.ctrl; |
| |
| using zx; |
| |
| /// CpuPerformanceStateInfo::frequency_hz and CpuPerformanceStateInfo::voltage_uv |
| /// are set to this if the frequency and voltage for the given performance state |
| /// are unknown respectively. |
| const FREQUENCY_UNKNOWN int64 = -1; |
| const VOLTAGE_UNKNOWN int64 = -1; |
| |
| /// A collection of some basic information for a given performance state. |
| type CpuPerformanceStateInfo = struct { |
| /// Frequency the core is operating at in hertz. |
| frequency_hz int64; |
| |
| // Voltage the core is operating at in microvolts. |
| voltage_uv int64; |
| }; |
| |
| protocol Device { |
| /// Returns information about a given performance state for this performance |
| /// domain. |
| GetPerformanceStateInfo(struct { |
| state uint32; |
| }) -> (struct { |
| info CpuPerformanceStateInfo; |
| }) error zx.status; |
| |
| /// Returns the number of logical cores contained within this performance |
| /// domain. |
| GetNumLogicalCores() -> (struct { |
| count uint64; |
| }); |
| |
| /// Returns a global system-wide core ID for the nth core in this |
| /// performance domain. `index` must be a value in the range [0, n) where |
| /// n is the value returned by GetNumLogicalCores(). |
| GetLogicalCoreId(struct { |
| index uint64; |
| }) -> (struct { |
| id uint64; |
| }); |
| }; |