[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v4 06/17] spapr: add rtas_st_buffer_direct() helper
From: |
Michael Roth |
Subject: |
[Qemu-ppc] [PATCH v4 06/17] spapr: add rtas_st_buffer_direct() helper |
Date: |
Tue, 23 Dec 2014 06:30:20 -0600 |
This is similar to the existing rtas_st_buffer(), but for case where
the guest is not expecting a length-encoded byte array. Namely,
for calls where an "work area" buffer is used to pass around
arbitrary fields/data.
Signed-off-by: Michael Roth <address@hidden>
---
include/hw/ppc/spapr.h | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 716bff4..b4daa42 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -413,6 +413,13 @@ 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);
}
+static inline void rtas_st_buffer_direct(target_ulong phys,
+ target_ulong phys_len,
+ uint8_t *buffer, uint16_t buffer_len)
+{
+ cpu_physical_memory_write(ppc64_phys_to_real(phys), buffer,
+ MIN(buffer_len, phys_len));
+}
static inline void rtas_st_buffer(target_ulong phys, target_ulong phys_len,
uint8_t *buffer, uint16_t buffer_len)
@@ -422,8 +429,7 @@ static inline void rtas_st_buffer(target_ulong phys,
target_ulong phys_len,
}
stw_be_phys(&address_space_memory,
ppc64_phys_to_real(phys), buffer_len);
- cpu_physical_memory_write(ppc64_phys_to_real(phys + 2),
- buffer, MIN(buffer_len, phys_len - 2));
+ rtas_st_buffer_direct(phys + 2, phys_len - 2, buffer, buffer_len);
}
typedef void (*spapr_rtas_fn)(PowerPCCPU *cpu, sPAPREnvironment *spapr,
--
1.9.1
- [Qemu-ppc] [PATCH v4 00/17] spapr: add support for pci hotplug, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 01/17] docs: add sPAPR hotplug/dynamic-reconfiguration documentation, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 04/17] spapr_rtas: add set-indicator RTAS interface, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 05/17] spapr_rtas: add get-sensor-state RTAS interface, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 03/17] spapr_rtas: add get/set-power-level RTAS interfaces, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 06/17] spapr: add rtas_st_buffer_direct() helper,
Michael Roth <=
- [Qemu-ppc] [PATCH v4 02/17] spapr_drc: initial implementation of sPAPRDRConnector device, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 07/17] spapr_rtas: add ibm, configure-connector RTAS interface, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 08/17] spapr_events: re-use EPOW event infrastructure for hotplug events, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 09/17] spapr_events: event-scan RTAS interface, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 11/17] spapr: introduce pseries-2.3 machine type, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 10/17] spapr_drc: add spapr_drc_populate_dt(), Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 12/17] spapr_pci: add dynamic-reconfiguration option for spapr-pci-host-bridge, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 13/17] spapr_pci: create DRConnectors for each PCI slot during PHB realize, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 14/17] spapr_pci: populate DRC dt entries for PHBs, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 16/17] spapr_pci: enable basic hotplug operations, Michael Roth, 2014/12/23