summaryrefslogtreecommitdiffstats
path: root/include/hw/ppc
diff options
context:
space:
mode:
authorGavin Shan2015-09-01 03:05:12 +0200
committerDavid Gibson2015-09-23 02:51:09 +0200
commita14aa92b20c5482b9b694901304b8100b3c4b5a1 (patch)
treea392e720fefe9f3e575003d43cb7869f9e9cc35d /include/hw/ppc
parentspapr_rtas: Prevent QEMU crash during hotplug without a prior device_add (diff)
downloadqemu-a14aa92b20c5482b9b694901304b8100b3c4b5a1.tar.gz
qemu-a14aa92b20c5482b9b694901304b8100b3c4b5a1.tar.xz
qemu-a14aa92b20c5482b9b694901304b8100b3c4b5a1.zip
sPAPR: Introduce rtas_ldq()
This introduces rtas_ldq() to load 64-bits parameter from continuous two 4-bytes memory chunk of RTAS parameter buffer, to simplify the code. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'include/hw/ppc')
-rw-r--r--include/hw/ppc/spapr.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index d2509677fb..cbe3463e32 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -489,6 +489,11 @@ static inline uint32_t rtas_ld(target_ulong phys, int n)
return ldl_be_phys(&address_space_memory, ppc64_phys_to_real(phys + 4*n));
}
+static inline uint64_t rtas_ldq(target_ulong phys, int n)
+{
+ return (uint64_t)rtas_ld(phys, n) << 32 | rtas_ld(phys, n + 1);
+}
+
static inline void rtas_st(target_ulong phys, int n, uint32_t val)
{
stl_be_phys(&address_space_memory, ppc64_phys_to_real(phys + 4*n), val);