[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 20/32] spapr: Add rtas_st_buffer utility function
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PULL 20/32] spapr: Add rtas_st_buffer utility function |
Date: |
Fri, 27 Jun 2014 13:52:12 +0200 |
From: Sam bobroff <address@hidden>
Add a function to write lengh + data into a buffer as required for the
emulation of the RTAS ibm,get-system-parameter call.
If the destination is smaller than the source, the write is truncated
and success is returned. This matches the behaviour of pHyp.
This will be used in following patches.
Signed-off-by: Sam Bobroff <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
include/hw/ppc/spapr.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index f71d7de..25ca87f 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -412,6 +412,19 @@ 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(target_ulong phys, target_ulong phys_len,
+ uint8_t *buffer, uint16_t buffer_len)
+{
+ if (phys_len < 2) {
+ return;
+ }
+ 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));
+}
+
typedef void (*spapr_rtas_fn)(PowerPCCPU *cpu, sPAPREnvironment *spapr,
uint32_t token,
uint32_t nargs, target_ulong args,
--
1.8.1.4
- [Qemu-devel] [PULL 25/32] xics: Add xics_find_source(), (continued)
- [Qemu-devel] [PULL 25/32] xics: Add xics_find_source(), Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 29/32] xics: Implement xics_ics_free(), Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 32/32] PPC: e500: Only create dt entries for existing serial ports, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 21/32] spapr: Fix RTAS sysparm DIAGNOSTICS_RUN_MODE, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 24/32] xics: Add flags for interrupts, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 26/32] xics: Disable flags reset on xics reset, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 16/32] uninorth: Fix PCI hole size, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 06/32] target-ppc: fixed translation of mcrxr instruction, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 31/32] spapr_pci: Use XICS interrupt allocator and do not cache interrupts in PHB, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 28/32] spapr: Remove @next_irq, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 20/32] spapr: Add rtas_st_buffer utility function,
Alexander Graf <=
- [Qemu-devel] [PULL 27/32] spapr: Move interrupt allocator to xics, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 30/32] vmstate: Add preallocation for migrating arrays (VMS_ALLOC flag), Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 23/32] spapr: Add RTAS sysparm SPLPAR Characteristics, Alexander Graf, 2014/06/27
- Re: [Qemu-devel] [PULL 00/32] ppc patch queue 2014-06-27, Peter Maydell, 2014/06/29