nto_power_parameter

Updated: May 06, 2022

Values for power-management characteristics

Synopsis:

#include <sys/neutrino.h>
struct nto_power_parameter {
    _Uint16t parameter_type;
    _Uint16t clusterid;
    _Uint32t spare;
    union {
        struct nto_power_cluster {
            _Uint32t frequency_mask;
        } cluster;
        struct nto_power_cpu {
            _Uint32t cpuid;
            _Uint32t unloaded;
            struct {
                _Uint16t nonburst;
                _Uint16t burst;
        } cpu;
        struct nto_power_freq {
            _Uint32t performance;
            struct nto_power_range low;
            struct nto_power_range high;
            struct sigevent ev;
            _Uint32t max_cores_online_hint;
        } freq;
    } u;
};

Data:

parameter_type
The type of parameter PowerParameter() will set. Set as follows:
  • _NTO_PPT_DEFINE_CLUSTER — create a new CPU cluster.
  • _NTO_PPT_DEFINE_CPU — define CPU offline and online characteristics.
  • _NTO_PPT_DEFINE_FREQ — set CPU frequency characteristics.
A CPU cluster may include only a single CPU or multiple CPUs (see CPU clusters in the Programmer's Guide “Power Management” chapter).
clusterid
The CPU cluster.
Set to -1 (minus one) to create a new cluster (parameter_type set to _NTO_PPT_DEFINE_CLUSTER).
Set to the ID of the cluster whose characteristics you want to update (parameter_type set to _NTO_PPT_DEFINE_CPU or _NTO_PPT_DEFINE_FREQ). The cluster ID is returned by PowerParameter() when you call it to create a CPU cluster.
spare
For future use.
u
Power-management characteristics. One of cluster, cpu, or freq, depending on the value of parameter_type (see below).

cluster

The cluster data structure is used only if parameter_type is set to _NTO_PPT_DEFINE_CLUSTER; it includes the following member:
frequency_mask
Mask out the operating points you don't want to be available to the CPU cluster (see Managing operating points in the Programmer's Guide “Power Management” chapter).

cpu

The cpu data structure is used only if parameter_type is set to _NTO_PPT_DEFINE_CPU; its members include:
unloaded
The delay, in milliseconds, the kernel waits before dynamically taking a CPU offline.
loaded

The percentage of CPU load that the scheduler uses as a threshold to trigger an action. This action can be for burst and non-burst modes:

nonburst
When running in non-burst mode, the percentage of CPU load at which the scheduler judges the CPU as overloaded and begins the process of turning on an additional CPU.
burst
When running in burst mode, the percentage of CPU load at which the scheduler judges the CPU as overloaded and begins the process of turning on an additional CPU.

freq

The freq data structure is used only if parameter_type is set to _NTO_PPT_DEFINE_FREQ; its members include:
performance
A metric that can be used to compare CPU behavior at different frequencies.
low
The thresholds at which the kernel will move the CPU cluster to a lower frequency, if possible, and deliver a sigevent to inform the power-management process of the operating point change. These thresholds are the percentage of the maximum CPU load, and the duration, in milliseconds, at this load or lower (see nto_power_range).
high
The thresholds at which the kernel will move the CPU cluster to a higher frequency, if possible and deliver a sigevent to inform the power-management process of the operating point change. These thresholds are the percentage of the maximum CPU load, and the duration, in milliseconds, at this load or higher (see nto_power_range).
ev
The sigevent the kernel should deliver when the CPU moves to the specified frequency.

If the sigevent is marked with SIGEV_MAKE_UPDATEABLE(), the event will be updated with one of the _NTO_PFR_* enumerated values to indicate why the kernel wants to move the CPU cluster to a new operating point (within the operating points permitted by _NTO_PFR_MASK).

You can extract the parameter ID of the frequency the kernel is requesting with:

ev.sival_int >> _NTO_PFR_PARM_ID_SHIFT

Library:

libc

Description:

The nto_power_parameter structure is used to specify the power characteristics PowerParameter() will get or set. The structure is populated by different data based on the value of its parameter_type and cluster_id members. For more information, see the Data above and the Power Management chapter in the Programmer's Guide.