Skip to content

Commit

Permalink
pm: add macro for PM_HINT_STATE access
Browse files Browse the repository at this point in the history
Add macro for PM_HINT_STATE access when PM_HINT_PLATFORM_STATE_MASK
is used by platform.

Signed-off-by: Patrick Delaunay <[email protected]>
  • Loading branch information
patrickdelaunay committed Feb 22, 2024
1 parent 571857c commit e827df5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/include/kernel/pm.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (c) 2018, Linaro Limited
* Copyright (c) 2018-2024, Linaro Limited
*/

#ifndef __KERNEL_PM_H
Expand Down Expand Up @@ -30,6 +30,12 @@
#define PM_HINT_PLATFORM_STATE_MASK GENMASK_32(31, 16)
#define PM_HINT_PLATFORM_STATE_SHIFT U(16)

#define PM_HINT_STATE(x) ((x) & ~PM_HINT_PLATFORM_STATE_MASK)
#define PM_HINT_PLATFORM_STATE(x) \
(((x) & PM_HINT_PLATFORM_STATE_MASK) >> PM_HINT_PLATFORM_STATE_SHIFT)

#define PM_HINT_IS_STATE(x, name) (!!((x) & PM_HINT_ ## name ## _STATE))

/*
* PM_OP_SUSPEND: platform is suspending to a target low power state
* PM_OP_RESUME: platform is resuming from low power state
Expand Down

0 comments on commit e827df5

Please sign in to comment.