[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 21/33] spapr: add rtas_st_buffer_direct() helper
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PATCH 21/33] spapr: add rtas_st_buffer_direct() helper |
Date: |
Thu, 7 May 2015 15:33:47 +1000 |
From: Michael Roth <address@hidden>
This is similar to the existing rtas_st_buffer(), but for cases
where the guest is not expecting a length-encoded byte array.
Namely, for calls where a "work area" buffer is used to pass
around arbitrary fields/data.
Signed-off-by: Michael Roth <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <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 8810911..65ef7dd 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -464,6 +464,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)
@@ -473,8 +480,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,
--
2.1.0
- [Qemu-ppc] [PATCH 09/33] spapr_iommu: Make spapr_tce_find_by_liobn() public, (continued)
- [Qemu-ppc] [PATCH 09/33] spapr_iommu: Make spapr_tce_find_by_liobn() public, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 14/33] hw/ppc/spapr: Fix error message when firmware could not be loaded, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 10/33] spapr_pci: Rework device-tree rendering, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 13/33] pseries: Add pseries-2.4 machine type, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 11/33] spapr_iommu: Give unique QOM name to TCE table, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 08/33] spapr_pci: Make find_phb()/find_dev() public, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 15/33] hw/ppc/spapr: Use error_report() instead of hw_error(), David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 32/33] spapr: override default ram size to 512MB, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 12/33] hw/ppc/spapr_iommu: Fix the check for invalid upper bits in liobn, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 18/33] spapr_rtas: add get/set-power-level RTAS interfaces, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 21/33] spapr: add rtas_st_buffer_direct() helper,
David Gibson <=
- [Qemu-ppc] [PATCH 27/33] spapr_pci: create DRConnectors for each PCI slot during PHB realize, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 33/33] pseries: Enable in-kernel H_LOGICAL_CI_{LOAD, STORE} implementations, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 19/33] spapr_rtas: add set-indicator RTAS interface, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 30/33] spapr_pci: emit hotplug add/remove events during hotplug, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 24/33] spapr_events: event-scan RTAS interface, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 28/33] pci: make pci_bar useable outside pci.c, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 26/33] spapr_pci: add dynamic-reconfiguration option for spapr-pci-host-bridge, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 16/33] docs: add sPAPR hotplug/dynamic-reconfiguration documentation, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 22/33] spapr_rtas: add ibm, configure-connector RTAS interface, David Gibson, 2015/05/07
- [Qemu-ppc] [PATCH 31/33] machine: add default_ram_size to machine class, David Gibson, 2015/05/07