Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PM: allow custom policy to use default policy code without duplication #62550

Closed
wants to merge 2 commits into from

Commits on Sep 12, 2023

  1. pm: split default policy so custom code can call it

    When implementing a custom PM policy, you might want to use the default
    behaviour in addition to other customization. So instead of reimplenting
    the code from the default policy, just call the function in the custom
    policy code. example:
    
    const struct pm_state_info *pm_policy_next_state(uint8_t cpu, int32_t ticks)
    {
    
           /* custom policy code here */
           ....
           ....
           ....
           /* end custom policy */
           return pm_policy_default_next_state(cpu, ticks);
    }
    
    Signed-off-by: Anas Nashif <anas.nashif@intel.com>
    nashif committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    c12c697 View commit details
    Browse the repository at this point in the history
  2. doc: pm: do not hide pm_policy_next_state

    This is a public API that can be implemented by the application to
    provide a custom policy.
    
    Signed-off-by: Anas Nashif <anas.nashif@intel.com>
    nashif committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    1a287d9 View commit details
    Browse the repository at this point in the history