diff options
author | Gavin Shan | 2015-09-01 03:05:12 +0200 |
---|---|---|
committer | David Gibson | 2015-09-23 02:51:09 +0200 |
commit | a14aa92b20c5482b9b694901304b8100b3c4b5a1 (patch) | |
tree | a392e720fefe9f3e575003d43cb7869f9e9cc35d /include/hw/ppc/spapr.h | |
parent | spapr_rtas: Prevent QEMU crash during hotplug without a prior device_add (diff) | |
download | qemu-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/spapr.h')
-rw-r--r-- | include/hw/ppc/spapr.h | 5 |
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); |