[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [RFC for-2.13 03/12] target/ppc: Pass cpu instead of env
From: |
Cédric Le Goater |
Subject: |
Re: [Qemu-ppc] [RFC for-2.13 03/12] target/ppc: Pass cpu instead of env to ppc_create_page_sizes_prop() |
Date: |
Tue, 27 Mar 2018 10:41:01 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 03/27/2018 06:37 AM, David Gibson wrote:
> As a rule we prefer to pass PowerPCCPU instead of CPUPPCState, and this
> change will make some things simpler later on.
>
> Signed-off-by: David Gibson <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
> ---
> hw/ppc/fdt.c | 5 +++--
> hw/ppc/pnv.c | 4 ++--
> hw/ppc/spapr.c | 4 ++--
> include/hw/ppc/fdt.h | 2 +-
> 4 files changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/hw/ppc/fdt.c b/hw/ppc/fdt.c
> index 2ffc5866e4..2721603ffa 100644
> --- a/hw/ppc/fdt.c
> +++ b/hw/ppc/fdt.c
> @@ -13,9 +13,10 @@
> #include "hw/ppc/fdt.h"
>
> #if defined(TARGET_PPC64)
> -size_t ppc_create_page_sizes_prop(CPUPPCState *env, uint32_t *prop,
> - size_t maxsize)
> +size_t ppc_create_page_sizes_prop(PowerPCCPU *cpu, uint32_t *prop,
> + size_t maxsize)
> {
> + CPUPPCState *env = &cpu->env;
> size_t maxcells = maxsize / sizeof(uint32_t);
> int i, j, count;
> uint32_t *p = prop;
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index 98ee3c607a..5a79b24828 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -209,8 +209,8 @@ static void pnv_dt_core(PnvChip *chip, PnvCore *pc, void
> *fdt)
> _FDT((fdt_setprop_cell(fdt, offset, "ibm,dfp", 1)));
> }
>
> - page_sizes_prop_size = ppc_create_page_sizes_prop(env, page_sizes_prop,
> - sizeof(page_sizes_prop));
> + page_sizes_prop_size = ppc_create_page_sizes_prop(cpu, page_sizes_prop,
> +
> sizeof(page_sizes_prop));
> if (page_sizes_prop_size) {
> _FDT((fdt_setprop(fdt, offset, "ibm,segment-page-sizes",
> page_sizes_prop, page_sizes_prop_size)));
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 2c0be8c898..a35bffd524 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -581,8 +581,8 @@ static void spapr_populate_cpu_dt(CPUState *cs, void
> *fdt, int offset,
> _FDT((fdt_setprop_cell(fdt, offset, "ibm,dfp", 1)));
> }
>
> - page_sizes_prop_size = ppc_create_page_sizes_prop(env, page_sizes_prop,
> - sizeof(page_sizes_prop));
> + page_sizes_prop_size = ppc_create_page_sizes_prop(cpu, page_sizes_prop,
> +
> sizeof(page_sizes_prop));
> if (page_sizes_prop_size) {
> _FDT((fdt_setprop(fdt, offset, "ibm,segment-page-sizes",
> page_sizes_prop, page_sizes_prop_size)));
> diff --git a/include/hw/ppc/fdt.h b/include/hw/ppc/fdt.h
> index bd5b0a8c3d..a8cd85069f 100644
> --- a/include/hw/ppc/fdt.h
> +++ b/include/hw/ppc/fdt.h
> @@ -23,7 +23,7 @@
> } \
> } while (0)
>
> -size_t ppc_create_page_sizes_prop(CPUPPCState *env, uint32_t *prop,
> +size_t ppc_create_page_sizes_prop(PowerPCCPU *cpu, uint32_t *prop,
> size_t maxsize);
>
> #endif /* PPC_FDT_H */
>
- [Qemu-ppc] [RFC for-2.13 00/12] target/ppc: Assorted cpu cleanups (esp. hash64 MMU), David Gibson, 2018/03/27
- [Qemu-ppc] [RFC for-2.13 02/12] target/ppc: Simplify cpu valid check in ppc_cpu_realize, David Gibson, 2018/03/27
- [Qemu-ppc] [RFC for-2.13 01/12] target/ppc: Standardize instance_init and realize function names, David Gibson, 2018/03/27
- [Qemu-ppc] [RFC for-2.13 03/12] target/ppc: Pass cpu instead of env to ppc_create_page_sizes_prop(), David Gibson, 2018/03/27
- [Qemu-ppc] [RFC for-2.13 04/12] target/ppc: Avoid taking "env" parameter to mmu-hash64 functions, David Gibson, 2018/03/27
- [Qemu-ppc] [RFC for-2.13 05/12] target/ppc: Remove fallback 64k pagesize information, David Gibson, 2018/03/27
[Qemu-ppc] [RFC for-2.13 06/12] target/ppc: Move page size setup to helper function, David Gibson, 2018/03/27