Zephyr API Documentation 4.3.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

CPU Frequency Scaling Policy. More...

Functions

int cpu_freq_policy_select_pstate (const struct pstate **pstate_out)
 Get the next P-state from CPU frequency scaling policy.
void cpu_freq_policy_reset (void)
 Reset data structures used by CPU frequency scaling policy.
const struct pstatecpu_freq_policy_pstate_set (const struct pstate *state)
 Set the CPU frequency scaling P-state according to policy.

Detailed Description

CPU Frequency Scaling Policy.

Since
4.3
Version
0.1.0

Function Documentation

◆ cpu_freq_policy_pstate_set()

const struct pstate * cpu_freq_policy_pstate_set ( const struct pstate * state)

#include <zephyr/cpu_freq/policy.h>

Set the CPU frequency scaling P-state according to policy.

This function is implemented by a CPU frequency scaling policy selected via Kconfig. It accepts a P-state previously obtained by a call to :c:func:cpu_freq_policy_select_pstate and attempts to apply it according to the policy. The policy may choose to apply the selected P-state, or apply a different P-state, or ignore the request altogether. This function is automatically invoked by the CPU frequency scaling subsystem and should not be called directly by application code.

Parameters
statePointer to a P-state
Returns
Pointer to the applied P-state, or NULL if nothing applied

◆ cpu_freq_policy_reset()

void cpu_freq_policy_reset ( void )

#include <zephyr/cpu_freq/policy.h>

Reset data structures used by CPU frequency scaling policy.

This function is implemented by a CPU frequency scaling policy selected via Kconfig. It resets any data structured needed by the policy. It is automatically invoked by the CPU frequency scaling subsystem and should not be called directly by application code.

◆ cpu_freq_policy_select_pstate()

int cpu_freq_policy_select_pstate ( const struct pstate ** pstate_out)

#include <zephyr/cpu_freq/policy.h>

Get the next P-state from CPU frequency scaling policy.

This function is implemented by a CPU frequency scaling policy selected via Kconfig. The caller must ensure that the current CPU does not change. If called from an ISR or a single CPU system, this restriction is automatically met. If called from a thread on an SMP system, either interrupts or the scheduler must be disabled to ensure the current CPU does not change.

Parameters
pstate_outPointer to the P-state struct where the next P-state is returned.
Return values
0in case of success, nonzero in case of failure.