Skip to content

Commit 6df3e14

Browse files
David BrazdilMarc Zyngier
David Brazdil
authored and
Marc Zyngier
committed
psci: Add accessor for psci_0_1_function_ids
Make it possible to retrieve a copy of the psci_0_1_function_ids struct. This is useful for KVM if it is configured to intercept host's PSCI SMCs. Signed-off-by: David Brazdil <dbrazdil@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Acked-by: Mark Rutland <mark.rutland@arm.com> Link: https://lore.kernel.org/r/20201202184122.26046-7-dbrazdil@google.com
1 parent 82ac62d commit 6df3e14

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

drivers/firmware/psci/psci.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,13 @@ typedef unsigned long (psci_fn)(unsigned long, unsigned long,
5858
unsigned long, unsigned long);
5959
static psci_fn *invoke_psci_fn;
6060

61-
struct psci_0_1_function_ids {
62-
u32 cpu_suspend;
63-
u32 cpu_on;
64-
u32 cpu_off;
65-
u32 migrate;
66-
};
67-
6861
static struct psci_0_1_function_ids psci_0_1_function_ids;
6962

63+
struct psci_0_1_function_ids get_psci_0_1_function_ids(void)
64+
{
65+
return psci_0_1_function_ids;
66+
}
67+
7068
#define PSCI_0_2_POWER_STATE_MASK \
7169
(PSCI_0_2_POWER_STATE_ID_MASK | \
7270
PSCI_0_2_POWER_STATE_TYPE_MASK | \

include/linux/psci.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ struct psci_operations {
3434

3535
extern struct psci_operations psci_ops;
3636

37+
struct psci_0_1_function_ids {
38+
u32 cpu_suspend;
39+
u32 cpu_on;
40+
u32 cpu_off;
41+
u32 migrate;
42+
};
43+
44+
struct psci_0_1_function_ids get_psci_0_1_function_ids(void);
45+
3746
#if defined(CONFIG_ARM_PSCI_FW)
3847
int __init psci_dt_init(void);
3948
#else

0 commit comments

Comments
 (0)