Commit 45c334e6 authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Hans de Goede

ARM: PSCI: Add helper functions to access per-CPU target PC storage

Now that we have a data section, add helper functions to save and fetch
per-CPU target PC.
Signed-off-by: default avatarChen-Yu Tsai <>
Signed-off-by: default avatarHans de Goede <>
parent a5aa7ff3
......@@ -19,7 +19,7 @@ endif
obj-$(CONFIG_ARMV7_NONSEC) += nonsec_virt.o virt-v7.o virt-dt.o
obj-$(CONFIG_ARMV7_PSCI) += psci.o
obj-$(CONFIG_ARMV7_PSCI) += psci.o psci-common.o
obj-$(CONFIG_IPROC) += iproc-common/
obj-$(CONFIG_KONA) += kona-common/
* Common PSCI functions
* Copyright (C) 2016 Chen-Yu Tsai
* Author: Chen-Yu Tsai <>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <>.
#include <config.h>
#include <asm/armv7.h>
#include <asm/macro.h>
#include <asm/psci.h>
#include <asm/secure.h>
#include <linux/linkage.h>
static u32 psci_target_pc[CONFIG_ARMV7_PSCI_NR_CPUS] __secure_data = { 0 };
void __secure psci_save_target_pc(int cpu, u32 pc)
psci_target_pc[cpu] = pc;
u32 __secure psci_get_target_pc(int cpu)
return psci_target_pc[cpu];
......@@ -54,6 +54,10 @@
#ifndef __ASSEMBLY__
#include <asm/types.h>
/* These 2 helper functions assume cpu < CONFIG_ARMV7_PSCI_NR_CPUS */
u32 psci_get_target_pc(int cpu);
void psci_save_target_pc(int cpu, u32 pc);
void psci_cpu_entry(void);
u32 psci_get_cpu_id(void);
u32 psci_get_cpu_stack_top(int cpu);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment