public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: kvm@vger.kernel.org
Cc: pbonzini@redhat.com, rkrcmar@redhat.com
Subject: [PATCH kvm-unit-tests 2/6] lib/arm/psci: make psci less ugly
Date: Thu, 25 May 2017 12:28:45 +0200	[thread overview]
Message-ID: <20170525102849.22754-3-drjones@redhat.com> (raw)
In-Reply-To: <20170525102849.22754-1-drjones@redhat.com>

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 lib/arm/asm/psci.h   |  6 ++----
 lib/arm/psci.c       | 10 +++++++---
 lib/arm64/asm/psci.h | 16 +---------------
 3 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/lib/arm/asm/psci.h b/lib/arm/asm/psci.h
index 11ac45028d78..eeb55cf299d1 100644
--- a/lib/arm/asm/psci.h
+++ b/lib/arm/asm/psci.h
@@ -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);
diff --git a/lib/arm/psci.c b/lib/arm/psci.c
index aca88851171f..a14acddeefd3 100644
--- a/lib/arm/psci.c
+++ b/lib/arm/psci.c
@@ -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);
diff --git a/lib/arm64/asm/psci.h b/lib/arm64/asm/psci.h
index 0a7d7c854e2b..783b36ef579e 100644
--- a/lib/arm64/asm/psci.h
+++ b/lib/arm64/asm/psci.h
@@ -1,15 +1 @@
-#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"
-- 
2.9.4

  parent reply	other threads:[~2017-05-25 10:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-25 10:28 [PATCH kvm-unit-tests 0/6] arm/arm64: some cleanups Andrew Jones
2017-05-25 10:28 ` [PATCH kvm-unit-tests 1/6] lib/arm/gic: gic_version cleanup Andrew Jones
2017-05-25 13:53   ` Paolo Bonzini
2017-05-25 14:28     ` Andrew Jones
2017-05-25 10:28 ` Andrew Jones [this message]
2017-05-25 10:28 ` [PATCH kvm-unit-tests 3/6] lib/arm/smp: introduce smp_run Andrew Jones
2017-05-25 13:56   ` Paolo Bonzini
2017-05-25 14:41     ` Andrew Jones
2017-05-25 15:07       ` Paolo Bonzini
2017-05-26 11:47         ` Andrew Jones
2017-05-26 12:11           ` Paolo Bonzini
2017-05-25 10:28 ` [PATCH kvm-unit-tests 4/6] arm/arm64: selftest: apply smp_run Andrew Jones
2017-05-25 10:28 ` [PATCH kvm-unit-tests 5/6] arm/arm64: spinlock-test: " Andrew Jones
2017-05-25 10:28 ` [PATCH kvm-unit-tests 6/6] arm/arm64: gic: " Andrew Jones
2017-05-25 13:56 ` [PATCH kvm-unit-tests 0/6] arm/arm64: some cleanups Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170525102849.22754-3-drjones@redhat.com \
    --to=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox