Zephyr API Documentation 4.3.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
CPU Frequency (CPUFreq)

Dynamic CPU Frequency Scaling. More...

Topics

 CPU Frequency Policy
 CPU Frequency Scaling Policy.
 CPU Frequency pstate
 CPU Frequency Scaling Performance State (pstate)

Functions

int cpu_freq_pstate_set (const struct pstate *state)
 Request processor set the given performance state.

Detailed Description

Dynamic CPU Frequency Scaling.

Since
4.3
Version
0.1.0

Function Documentation

◆ cpu_freq_pstate_set()

int cpu_freq_pstate_set ( const struct pstate * state)

#include <zephyr/cpu_freq/cpu_freq.h>

Request processor set the given performance state.

To be implemented by the SoC. This API abstracts the hardware and SoC specific calls required to change the performance state of the current CPU. 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.

Note
It is not guaranteed that the performance state will be set immediately, or at all.
Parameters
statePointer to performance state.
Return values
0if request received successfully, -errno in case of failure.