Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Typedefs

typedef int(* pm_s2ram_system_off_fn_t) (void)
 System off function.
 

Functions

int arch_pm_s2ram_suspend (pm_s2ram_system_off_fn_t system_off)
 Save CPU context on suspend.
 

Detailed Description

Typedef Documentation

◆ pm_s2ram_system_off_fn_t

typedef int(* pm_s2ram_system_off_fn_t) (void)

#include <zephyr/arch/common/pm_s2ram.h>

System off function.

This function is passed as argument and called by arch_pm_s2ram_suspend to power the system off after the CPU context has been saved.

This function never returns if the system is powered off. If the operation cannot be performed a proper value is returned and the code must take care of restoring the system in a fully operational state before returning.

Return values
noneThe system is powered off.
-EBUSYThe system is busy and cannot be powered off at this time.
-errnoOther error codes.

Function Documentation

◆ arch_pm_s2ram_suspend()

int arch_pm_s2ram_suspend ( pm_s2ram_system_off_fn_t  system_off)

#include <zephyr/arch/common/pm_s2ram.h>

Save CPU context on suspend.

This function is used on suspend-to-RAM (S2RAM) to save the CPU context in (retained) RAM before powering the system off using the provided function. This function is usually called from the PM subsystem / hooks.

The CPU context is usually the minimum set of CPU registers which content must be restored on resume to let the platform resume its execution from the point it left at the time of suspension.

Parameters
system_offFunction to power off the system.
Return values
0The CPU context was successfully saved and restored.
-EBUSYThe system is busy and cannot be suspended at this time.
-errnoNegative errno code in case of failure.