[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 08/28] spapr: Remove rtas_st_buffer_direct()
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 08/28] spapr: Remove rtas_st_buffer_direct() |
Date: |
Mon, 25 Jan 2016 12:15:07 +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 8b702b5..eac1556 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -505,6 +505,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,
@@ -570,8 +577,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:
@@ -596,8 +602,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
@@ -606,9 +611,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 18/28] pseries: Clean up error reporting in htab migration functions, (continued)
- [Qemu-ppc] [PULL 18/28] pseries: Clean up error reporting in htab migration functions, David Gibson, 2016/01/24
- [Qemu-ppc] [PULL 06/28] cuda: add missing fields to VMStateDescription, David Gibson, 2016/01/24
- [Qemu-ppc] [PULL 19/28] target-ppc: kvm: fix floating point registers sync on little-endian hosts, David Gibson, 2016/01/24
- [Qemu-ppc] [PULL 13/28] pseries: Clean up error handling in spapr_validate_node_memory(), David Gibson, 2016/01/24
- [Qemu-ppc] [PULL 22/28] target-ppc: gdbstub: introduce avr_need_swap(), David Gibson, 2016/01/24
- [Qemu-ppc] [PULL 12/28] pseries: Clean up error handling of spapr_cpu_init(), David Gibson, 2016/01/24
- [Qemu-ppc] [PULL 11/28] ppc: Clean up error handling in ppc_set_compat(), David Gibson, 2016/01/24
- [Qemu-ppc] [PULL 14/28] pseries: Clean up error handling in spapr_vga_init(), David Gibson, 2016/01/24
- [Qemu-ppc] [PULL 27/28] cuda.c: return error for unknown commands, David Gibson, 2016/01/24
- [Qemu-ppc] [PULL 20/28] target-ppc: rename and export maybe_bswap_register(), David Gibson, 2016/01/24
- [Qemu-ppc] [PULL 08/28] spapr: Remove rtas_st_buffer_direct(),
David Gibson <=
- [Qemu-ppc] [PULL 28/28] uninorth.c: add support for UniNorth kMacRISCPCIAddressSelect (0x48) register, David Gibson, 2016/01/24
- [Qemu-ppc] [PULL 07/28] spapr: Small fixes to rtas_ibm_get_system_parameter, remove rtas_st_buffer, David Gibson, 2016/01/24
- [Qemu-ppc] [PULL 23/28] target-ppc: gdbstub: fix altivec registers for little-endian guests, David Gibson, 2016/01/24
- [Qemu-ppc] [PULL 24/28] target-ppc: gdbstub: fix spe registers for little-endian guests, David Gibson, 2016/01/24
- [Qemu-ppc] [PULL 25/28] target-ppc: gdbstub: Add VSX support, David Gibson, 2016/01/24
- Re: [Qemu-ppc] [PULL 00/28] ppc-for-2.6 queue 20160125, Peter Maydell, 2016/01/25