diff mbox

[U-Boot,03/10] ARM: PSCI: export common PSCI function declarations for C code

Message ID 1464007306-30269-4-git-send-email-wens@csie.org
State Superseded
Delegated to: Hans de Goede
Headers show

Commit Message

Chen-Yu Tsai May 23, 2016, 12:41 p.m. UTC
Some common PSCI functions are written in assembly, but it should be
possible to use them from C code.

Add function declarations for C code to consume.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/include/asm/psci.h | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Marc Zyngier May 24, 2016, 9:58 a.m. UTC | #1
On 23/05/16 13:41, Chen-Yu Tsai wrote:
> Some common PSCI functions are written in assembly, but it should be
> possible to use them from C code.
> 
> Add function declarations for C code to consume.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  arch/arm/include/asm/psci.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h
> index 128a606444fe..5db33562a299 100644
> --- a/arch/arm/include/asm/psci.h
> +++ b/arch/arm/include/asm/psci.h
> @@ -33,6 +33,14 @@
>  #define ARM_PSCI_RET_DENIED		(-3)
>  
>  #ifndef __ASSEMBLY__
> +#include <asm/types.h>
> +#include <linux/compiler.h>
> +
> +void __section("._secure.text") psci_cpu_entry(void);
> +u32 __section("._secure.text") psci_get_cpu_id(void);
> +u32 __section("._secure.text") psci_get_cpu_stack_top(int cpu);
> +void __section("._secure.text") psci_cpu_off_common(void);
> +

I may be wrong, but I don't think the section matters for prototypes. It
is only at the location where the code is actually generated that it is
actually useful.

Thanks,

	M.
Chen-Yu Tsai May 24, 2016, 3:55 p.m. UTC | #2
On Tue, May 24, 2016 at 5:58 PM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> On 23/05/16 13:41, Chen-Yu Tsai wrote:
>> Some common PSCI functions are written in assembly, but it should be
>> possible to use them from C code.
>>
>> Add function declarations for C code to consume.
>>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> ---
>>  arch/arm/include/asm/psci.h | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h
>> index 128a606444fe..5db33562a299 100644
>> --- a/arch/arm/include/asm/psci.h
>> +++ b/arch/arm/include/asm/psci.h
>> @@ -33,6 +33,14 @@
>>  #define ARM_PSCI_RET_DENIED          (-3)
>>
>>  #ifndef __ASSEMBLY__
>> +#include <asm/types.h>
>> +#include <linux/compiler.h>
>> +
>> +void __section("._secure.text") psci_cpu_entry(void);
>> +u32 __section("._secure.text") psci_get_cpu_id(void);
>> +u32 __section("._secure.text") psci_get_cpu_stack_top(int cpu);
>> +void __section("._secure.text") psci_cpu_off_common(void);
>> +
>
> I may be wrong, but I don't think the section matters for prototypes. It
> is only at the location where the code is actually generated that it is
> actually useful.

You're right. Dropping the section attributes here.

ChenYu
diff mbox

Patch

diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h
index 128a606444fe..5db33562a299 100644
--- a/arch/arm/include/asm/psci.h
+++ b/arch/arm/include/asm/psci.h
@@ -33,6 +33,14 @@ 
 #define ARM_PSCI_RET_DENIED		(-3)
 
 #ifndef __ASSEMBLY__
+#include <asm/types.h>
+#include <linux/compiler.h>
+
+void __section("._secure.text") psci_cpu_entry(void);
+u32 __section("._secure.text") psci_get_cpu_id(void);
+u32 __section("._secure.text") psci_get_cpu_stack_top(int cpu);
+void __section("._secure.text") psci_cpu_off_common(void);
+
 int psci_update_dt(void *fdt);
 void psci_board_init(void);
 #endif /* ! __ASSEMBLY__ */