Commit c535b2f8 authored by Andrew Jones's avatar Andrew Jones Committed by Paolo Bonzini
Browse files

lib/arm/psci: make psci less ugly



Signed-off-by: Andrew Jones's avatarAndrew Jones <drjones@redhat.com>
Message-Id: <20170525102849.22754-3-drjones@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent db198544
......@@ -3,10 +3,8 @@
#include <libcflat.h>
#include <linux/psci.h>
#define PSCI_INVOKE_ARG_TYPE u32
#define PSCI_FN_CPU_ON PSCI_0_2_FN_CPU_ON
extern int psci_invoke(u32 function_id, u32 arg0, u32 arg1, u32 arg2);
extern int psci_invoke(unsigned long function_id, unsigned long arg0,
unsigned long arg1, unsigned long arg2);
extern int psci_cpu_on(unsigned long cpuid, unsigned long entry_point);
extern void psci_sys_reset(void);
extern int cpu_psci_cpu_boot(unsigned int cpu);
......
......@@ -10,9 +10,9 @@
#include <asm/setup.h>
#include <asm/page.h>
#define T PSCI_INVOKE_ARG_TYPE
__attribute__((noinline))
int psci_invoke(T function_id, T arg0, T arg1, T arg2)
int psci_invoke(unsigned long function_id, unsigned long arg0,
unsigned long arg1, unsigned long arg2)
{
asm volatile(
"hvc #0"
......@@ -23,7 +23,11 @@ int psci_invoke(T function_id, T arg0, T arg1, T arg2)
int psci_cpu_on(unsigned long cpuid, unsigned long entry_point)
{
return psci_invoke(PSCI_FN_CPU_ON, cpuid, entry_point, 0);
#ifdef __arm__
return psci_invoke(PSCI_0_2_FN_CPU_ON, cpuid, entry_point, 0);
#else
return psci_invoke(PSCI_0_2_FN64_CPU_ON, cpuid, entry_point, 0);
#endif
}
extern void secondary_entry(void);
......
#ifndef _ASMARM64_PSCI_H_
#define _ASMARM64_PSCI_H_
#include <libcflat.h>
#include <linux/psci.h>
#define PSCI_INVOKE_ARG_TYPE u64
#define PSCI_FN_CPU_ON PSCI_0_2_FN64_CPU_ON
extern int psci_invoke(u64 function_id, u64 arg0, u64 arg1, u64 arg2);
extern int psci_cpu_on(unsigned long cpuid, unsigned long entry_point);
extern void psci_sys_reset(void);
extern int cpu_psci_cpu_boot(unsigned int cpu);
extern void cpu_psci_cpu_die(unsigned int cpu);
#endif /* _ASMARM64_PSCI_H_ */
#include "../../arm/asm/psci.h"
Supports Markdown
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