[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 08/40] spapr: Remove rtas_st_buffer_direct()
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 08/40] spapr: Remove rtas_st_buffer_direct() |
Date: |
Mon, 1 Feb 2016 13:30:36 +1100 |
rtas_st_buffer_direct() is a not particularly useful wrapper around
cpu_physical_memory_write(). All the callers are in
rtas_ibm_configure_connector, where it's better handled by local helper.
Signed-off-by: David Gibson <address@hidden>
Reviewed-by: Alexey Kardashevskiy <address@hidden>
---
hw/ppc/spapr_rtas.c | 17 ++++++++++-------
include/hw/ppc/spapr.h | 8 --------
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index ab11b32..19e903d 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -506,6 +506,13 @@ out:
#define CC_VAL_DATA_OFFSET ((CC_IDX_PROP_DATA_OFFSET + 1) * 4)
#define CC_WA_LEN 4096
+static void configure_connector_st(target_ulong addr, target_ulong offset,
+ const void *buf, size_t len)
+{
+ cpu_physical_memory_write(ppc64_phys_to_real(addr + offset),
+ buf, MIN(len, CC_WA_LEN - offset));
+}
+
static void rtas_ibm_configure_connector(PowerPCCPU *cpu,
sPAPRMachineState *spapr,
uint32_t token, uint32_t nargs,
@@ -571,8 +578,7 @@ static void rtas_ibm_configure_connector(PowerPCCPU *cpu,
/* provide the name of the next OF node */
wa_offset = CC_VAL_DATA_OFFSET;
rtas_st(wa_addr, CC_IDX_NODE_NAME_OFFSET, wa_offset);
- rtas_st_buffer_direct(wa_addr + wa_offset, CC_WA_LEN - wa_offset,
- (uint8_t *)name, strlen(name) + 1);
+ configure_connector_st(wa_addr, wa_offset, name, strlen(name) + 1);
resp = SPAPR_DR_CC_RESPONSE_NEXT_CHILD;
break;
case FDT_END_NODE:
@@ -597,8 +603,7 @@ static void rtas_ibm_configure_connector(PowerPCCPU *cpu,
/* provide the name of the next OF property */
wa_offset = CC_VAL_DATA_OFFSET;
rtas_st(wa_addr, CC_IDX_PROP_NAME_OFFSET, wa_offset);
- rtas_st_buffer_direct(wa_addr + wa_offset, CC_WA_LEN - wa_offset,
- (uint8_t *)name, strlen(name) + 1);
+ configure_connector_st(wa_addr, wa_offset, name, strlen(name) + 1);
/* provide the length and value of the OF property. data gets
* placed immediately after NULL terminator of the OF property's
@@ -607,9 +612,7 @@ static void rtas_ibm_configure_connector(PowerPCCPU *cpu,
wa_offset += strlen(name) + 1,
rtas_st(wa_addr, CC_IDX_PROP_LEN, prop_len);
rtas_st(wa_addr, CC_IDX_PROP_DATA_OFFSET, wa_offset);
- rtas_st_buffer_direct(wa_addr + wa_offset, CC_WA_LEN - wa_offset,
- (uint8_t *)((struct fdt_property
*)prop)->data,
- prop_len);
+ configure_connector_st(wa_addr, wa_offset, prop->data, prop_len);
resp = SPAPR_DR_CC_RESPONSE_NEXT_PROPERTY;
break;
case FDT_END:
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 1e10fc9..1f9e722 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -506,14 +506,6 @@ 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));
-}
-
typedef void (*spapr_rtas_fn)(PowerPCCPU *cpu, sPAPRMachineState *sm,
uint32_t token,
uint32_t nargs, target_ulong args,
--
2.5.0
- [Qemu-ppc] [PULL 30/40] target-ppc: Convert mmu-hash{32, 64}.[ch] from CPUPPCState to PowerPCCPU, (continued)
- [Qemu-ppc] [PULL 30/40] target-ppc: Convert mmu-hash{32, 64}.[ch] from CPUPPCState to PowerPCCPU, David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 02/40] target-ppc: use cpu_write_xer() helper in cpu_post_load, David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 09/40] spapr: Remove abuse of rtas_ld() in h_client_architecture_support, David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 20/40] target-ppc: rename and export maybe_bswap_register(), David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 13/40] pseries: Clean up error handling in spapr_validate_node_memory(), David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 04/40] macio: add dma_active to VMStateDescription, David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 14/40] pseries: Clean up error handling in spapr_vga_init(), David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 05/40] mac_dbdma: add DBDMA controller state to VMStateDescription, David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 10/40] spapr: Don't create ibm, dynamic-reconfiguration-memory w/o DR LMBs, David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 12/40] pseries: Clean up error handling of spapr_cpu_init(), David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 08/40] spapr: Remove rtas_st_buffer_direct(),
David Gibson <=
- [Qemu-ppc] [PULL 21/40] target-ppc: gdbstub: fix float registers for little-endian guests, David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 38/40] target-ppc: Allow more page sizes for POWER7 & POWER8 in TCG, David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 16/40] pseries: Clean up error handling in xics_system_init(), David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 34/40] target-ppc: Remove unused mmu models from ppc_tlb_invalidate_one, David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 26/40] pseries: Allow TCG h_enter to work with hotplugged memory, David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 36/40] target-ppc: Add new TLB invalidate by HPTE call for hash64 MMUs, David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 40/40] target-ppc: mcrfs should always update FEX/VX and only clear exception bits, David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 19/40] target-ppc: kvm: fix floating point registers sync on little-endian hosts, David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 18/40] pseries: Clean up error reporting in htab migration functions, David Gibson, 2016/01/31
- [Qemu-ppc] [PULL 33/40] target-ppc: Use actual page size encodings from HPTE, David Gibson, 2016/01/31