diff mbox

[v9,04/11] target-arm: Provide PSCI constants to generic QEMU code

Message ID 1385140638-10444-5-git-send-email-peter.maydell@linaro.org
State Accepted
Headers show

Commit Message

Peter Maydell Nov. 22, 2013, 5:17 p.m. UTC
Provide versions of the KVM PSCI constants to non-KVM code;
this will allow us to avoid an ifdef in boards which set up
a PSCI node in the device tree.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/kvm-consts.h |   12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Christoffer Dall Nov. 22, 2013, 5:52 p.m. UTC | #1
On Fri, Nov 22, 2013 at 05:17:11PM +0000, Peter Maydell wrote:
> Provide versions of the KVM PSCI constants to non-KVM code;
> this will allow us to avoid an ifdef in boards which set up
> a PSCI node in the device tree.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  target-arm/kvm-consts.h |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/target-arm/kvm-consts.h b/target-arm/kvm-consts.h
> index 6f56f72..4062f11 100644
> --- a/target-arm/kvm-consts.h
> +++ b/target-arm/kvm-consts.h
> @@ -36,6 +36,18 @@ MISMATCH_CHECK(CP_REG_SIZE_U32, KVM_REG_SIZE_U32)
>  MISMATCH_CHECK(CP_REG_SIZE_U64, KVM_REG_SIZE_U64)
>  MISMATCH_CHECK(CP_REG_ARM, KVM_REG_ARM)
>  
> +#define PSCI_FN_BASE 0x95c1ba5e
> +#define PSCI_FN(n) (PSCI_FN_BASE + (n))
> +#define PSCI_FN_CPU_SUSPEND PSCI_FN(0)
> +#define PSCI_FN_CPU_OFF PSCI_FN(1)
> +#define PSCI_FN_CPU_ON PSCI_FN(2)
> +#define PSCI_FN_MIGRATE PSCI_FN(3)
> +
> +MISMATCH_CHECK(PSCI_FN_CPU_SUSPEND, KVM_PSCI_FN_CPU_SUSPEND)
> +MISMATCH_CHECK(PSCI_FN_CPU_OFF, KVM_PSCI_FN_CPU_OFF)
> +MISMATCH_CHECK(PSCI_FN_CPU_ON, KVM_PSCI_FN_CPU_ON)
> +MISMATCH_CHECK(PSCI_FN_MIGRATE, KVM_PSCI_FN_MIGRATE)
> +
>  #undef MISMATCH_CHECK
>  
>  #endif
> -- 
> 1.7.9.5
> 
These are the defines specifially chosen for the KVM implementation of
PSCI 0.1 right?  I wonder if we should name them as such, but then it
conflicts with the actual KVM defines I guess.  Also, perhaps unrelated,
I guess it makes sense to reuse this base and these function IDs if we
add PSCI support to QEMU itself for TCG.  Hmmm.

-Christoffer
diff mbox

Patch

diff --git a/target-arm/kvm-consts.h b/target-arm/kvm-consts.h
index 6f56f72..4062f11 100644
--- a/target-arm/kvm-consts.h
+++ b/target-arm/kvm-consts.h
@@ -36,6 +36,18 @@  MISMATCH_CHECK(CP_REG_SIZE_U32, KVM_REG_SIZE_U32)
 MISMATCH_CHECK(CP_REG_SIZE_U64, KVM_REG_SIZE_U64)
 MISMATCH_CHECK(CP_REG_ARM, KVM_REG_ARM)
 
+#define PSCI_FN_BASE 0x95c1ba5e
+#define PSCI_FN(n) (PSCI_FN_BASE + (n))
+#define PSCI_FN_CPU_SUSPEND PSCI_FN(0)
+#define PSCI_FN_CPU_OFF PSCI_FN(1)
+#define PSCI_FN_CPU_ON PSCI_FN(2)
+#define PSCI_FN_MIGRATE PSCI_FN(3)
+
+MISMATCH_CHECK(PSCI_FN_CPU_SUSPEND, KVM_PSCI_FN_CPU_SUSPEND)
+MISMATCH_CHECK(PSCI_FN_CPU_OFF, KVM_PSCI_FN_CPU_OFF)
+MISMATCH_CHECK(PSCI_FN_CPU_ON, KVM_PSCI_FN_CPU_ON)
+MISMATCH_CHECK(PSCI_FN_MIGRATE, KVM_PSCI_FN_MIGRATE)
+
 #undef MISMATCH_CHECK
 
 #endif